Re: sequel command line tool: fail
Jeremey, thanks so much for replying to my question! Does it also work with em-mysql (if not, it could be that sequel is trying to load that)? em-mysql isn't really a standalone mysql driver. It requires mysqlplus itself to work. Can you try using the RUBYLIB environment variable and make sure that one of the working mysql libraries first? I tried this. It didn't work, but maybe I was doing something wrong? $ gem which mysql (checking gem mysql-2.7 for mysql) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/mysql.rb $ echo $RUBYLIB /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ sequel mysql://localhost/castle_gameserver?user=root Error: Sequel::DatabaseConnectionError: NameError uninitialized constant Mysql::CLIENT_MULTI_RESULTS/Library/Ruby/Gems/1.8/gems/ sequel-3.1.0/lib/sequel/adapters/mysql.rb:97:in `connect' Also, try this from irb (without requiring any mysql stuff explicitly): require 'sequel' rescue nil p $: That should give an indication of what mysql library sequel is loading. $ irb require 'sequel' rescue nil = true p $: [/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb, /Library/Ruby/Gems/1.8/gems/sequel-3.1.0/bin, / Library/Ruby/Gems/1.8/gems/sequel-3.1.0/lib, /Library/Ruby/Site/ 1.8, /Library/Ruby/Site/1.8/powerpc-darwin9.0, /Library/Ruby/Site/ 1.8/universal-darwin9.0, /Library/Ruby/Site, /System/Library/ Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8, /System/ Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ powerpc-darwin9.0, /System/Library/Frameworks/Ruby.framework/ Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0, .] = nil :( Any other ideas? All I want to do is be able to run migrations. Is there some way to do that from within irb? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sequel-talk group. To post to this group, send email to sequel-talk@googlegroups.com To unsubscribe from this group, send email to sequel-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~--~~~~--~~--~--~---
Re: sequel command line tool: fail
On Jul 2, 12:08 pm, Steve H p.wi...@gmail.com wrote: Can you try using the RUBYLIB environment variable and make sure that one of the working mysql libraries first? I tried this. It didn't work, but maybe I was doing something wrong? $ gem which mysql (checking gem mysql-2.7 for mysql) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/mysql.rb $ echo $RUBYLIB /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ sequel mysql://localhost/castle_gameserver?user=root Error: Sequel::DatabaseConnectionError: NameError uninitialized constant Mysql::CLIENT_MULTI_RESULTS/Library/Ruby/Gems/1.8/gems/ sequel-3.1.0/lib/sequel/adapters/mysql.rb:97:in `connect' RUBYLIB should be a directory, not a file: export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/ $ irb require 'sequel' rescue nil = true p $: [/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb, /Library/Ruby/Gems/1.8/gems/sequel-3.1.0/bin, / Library/Ruby/Gems/1.8/gems/sequel-3.1.0/lib, /Library/Ruby/Site/ 1.8, /Library/Ruby/Site/1.8/powerpc-darwin9.0, /Library/Ruby/Site/ 1.8/universal-darwin9.0, /Library/Ruby/Site, /System/Library/ Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8, /System/ Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ powerpc-darwin9.0, /System/Library/Frameworks/Ruby.framework/ Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0, .] = nil You have to go through those directories in order to find the first one that contains a mysql.rb or mysql.so file (maybe there's a different extension for shared library extensions on the Mac, I'm not sure). That one needs to support CLIENT_MULTI_RESULTS in order for Sequel to work. My guess is the first one doesn't work, so you need to set RUBYLIB to the directory containing the correct mysql file, or modify the load path manually so that that directory is the first one reached that contains a mysql file. Any other ideas? All I want to do is be able to run migrations. Is there some way to do that from within irb? Before you can run migrations, you need to setup your database connection. Once your database connection is setup, running migrations is trivial: Sequel::Migrator.apply(DB, '/path/to/migrations/dir') Jeremy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sequel-talk group. To post to this group, send email to sequel-talk@googlegroups.com To unsubscribe from this group, send email to sequel-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~--~~~~--~~--~--~---
Re: sequel command line tool: fail
Hmmm. Perhaps I missed something, but Sequel::Migrator is not defined: require 'sequel' = true DB = Sequel.connect(:adapter = 'mysql', :user = 'root', :database = 'castle_gameserver') = #Sequel::MySQL::Database: mysql:root@/castle_gameserver Sequel::Migrator.apply(DB, '/myproject/db/migrations/') NameError: uninitialized constant Sequel::Migrator from (irb):3 I thought maybe you forgot a middle module (like maybe Sequel::SQL::Migrator or something), so I checked the rdoc http://sequel.rubyforge.org/rdoc/index.html And searched for Migrator. Nothing. What am I doing wrong here? On a different note, since I'm not good at letting things go: I tried setting RUBYLIB as you show above, but now I get a new error: $ export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/ $ sequel mysql://localhost/castle_gameserver?user=root /usr/bin/sequel:19: undefined method `bin_path' for Gem:Module (NoMethodError) What gives? On Jul 2, 1:23 pm, Jeremy Evans jeremyeva...@gmail.com wrote: On Jul 2, 12:08 pm, Steve H p.wi...@gmail.com wrote: Can you try using the RUBYLIB environment variable and make sure that one of the working mysql libraries first? I tried this. It didn't work, but maybe I was doing something wrong? $ gem which mysql (checking gem mysql-2.7 for mysql) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/mysql.rb $ echo $RUBYLIB /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ sequel mysql://localhost/castle_gameserver?user=root Error: Sequel::DatabaseConnectionError: NameError uninitialized constant Mysql::CLIENT_MULTI_RESULTS/Library/Ruby/Gems/1.8/gems/ sequel-3.1.0/lib/sequel/adapters/mysql.rb:97:in `connect' RUBYLIB should be a directory, not a file: export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/ $ irb require 'sequel' rescue nil = true p $: [/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb, /Library/Ruby/Gems/1.8/gems/sequel-3.1.0/bin, / Library/Ruby/Gems/1.8/gems/sequel-3.1.0/lib, /Library/Ruby/Site/ 1.8, /Library/Ruby/Site/1.8/powerpc-darwin9.0, /Library/Ruby/Site/ 1.8/universal-darwin9.0, /Library/Ruby/Site, /System/Library/ Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8, /System/ Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ powerpc-darwin9.0, /System/Library/Frameworks/Ruby.framework/ Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0, .] = nil You have to go through those directories in order to find the first one that contains a mysql.rb or mysql.so file (maybe there's a different extension for shared library extensions on the Mac, I'm not sure). That one needs to support CLIENT_MULTI_RESULTS in order for Sequel to work. My guess is the first one doesn't work, so you need to set RUBYLIB to the directory containing the correct mysql file, or modify the load path manually so that that directory is the first one reached that contains a mysql file. Any other ideas? All I want to do is be able to run migrations. Is there some way to do that from within irb? Before you can run migrations, you need to setup your database connection. Once your database connection is setup, running migrations is trivial: Sequel::Migrator.apply(DB, '/path/to/migrations/dir') Jeremy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sequel-talk group. To post to this group, send email to sequel-talk@googlegroups.com To unsubscribe from this group, send email to sequel-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~--~~~~--~~--~--~---
Re: sequel command line tool: fail
Ahh! Aman to my rescue. Glad you're on this list as well as the EM one :) Yes, I installed the pure ruby mysql driver back when I had accidentally downloaded and installed MySQL x86_64, and my connection was super slow so I didn't replace it with x86 right away. I installed the pure ruby mysql gem manually (like an idiot). How can I now uninstall it? If I simply remove that mysql.rb file, will that work? Thanks for the help guys... -Steve On Jul 2, 1:35 pm, Aman Gupta themastermi...@gmail.com wrote: On Thu, Jul 2, 2009 at 12:08 PM, Steve Hp.wi...@gmail.com wrote: Jeremey, thanks so much for replying to my question! Does it also work with em-mysql (if not, it could be that sequel is trying to load that)? em-mysql isn't really a standalone mysql driver. It requires mysqlplus itself to work. Can you try using the RUBYLIB environment variable and make sure that one of the working mysql libraries first? I tried this. It didn't work, but maybe I was doing something wrong? $ gem which mysql (checking gem mysql-2.7 for mysql) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb I'm not sure how you ended up with a mysql.rb in your lib/ruby/1.8, but that's the pure ruby driver. You should be using the mysql or mysqlplus gem instead, which has a C extension driver. Aman $ export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/mysql.rb $ echo $RUBYLIB /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ sequel mysql://localhost/castle_gameserver?user=root Error: Sequel::DatabaseConnectionError: NameError uninitialized constant Mysql::CLIENT_MULTI_RESULTS/Library/Ruby/Gems/1.8/gems/ sequel-3.1.0/lib/sequel/adapters/mysql.rb:97:in `connect' Also, try this from irb (without requiring any mysql stuff explicitly): require 'sequel' rescue nil p $: That should give an indication of what mysql library sequel is loading. $ irb require 'sequel' rescue nil = true p $: [/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb, /Library/Ruby/Gems/1.8/gems/sequel-3.1.0/bin, / Library/Ruby/Gems/1.8/gems/sequel-3.1.0/lib, /Library/Ruby/Site/ 1.8, /Library/Ruby/Site/1.8/powerpc-darwin9.0, /Library/Ruby/Site/ 1.8/universal-darwin9.0, /Library/Ruby/Site, /System/Library/ Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8, /System/ Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ powerpc-darwin9.0, /System/Library/Frameworks/Ruby.framework/ Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0, .] = nil :( Any other ideas? All I want to do is be able to run migrations. Is there some way to do that from within irb? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sequel-talk group. To post to this group, send email to sequel-talk@googlegroups.com To unsubscribe from this group, send email to sequel-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~--~~~~--~~--~--~---
Re: sequel command line tool: fail
On Thu, Jul 2, 2009 at 1:58 PM, Steve Hp.wi...@gmail.com wrote: Ahh! Aman to my rescue. Glad you're on this list as well as the EM one :) Yes, I installed the pure ruby mysql driver back when I had accidentally downloaded and installed MySQL x86_64, and my connection was super slow so I didn't replace it with x86 right away. I installed the pure ruby mysql gem manually (like an idiot). How can I now uninstall it? If I simply remove that mysql.rb file, will that work? Removing the file should work, you can also see if there's a mysql directory in there you need to delete. Also the migrator was moved to an extension, simply require 'sequel/extensions/migration' Aman Thanks for the help guys... -Steve On Jul 2, 1:35 pm, Aman Gupta themastermi...@gmail.com wrote: On Thu, Jul 2, 2009 at 12:08 PM, Steve Hp.wi...@gmail.com wrote: Jeremey, thanks so much for replying to my question! Does it also work with em-mysql (if not, it could be that sequel is trying to load that)? em-mysql isn't really a standalone mysql driver. It requires mysqlplus itself to work. Can you try using the RUBYLIB environment variable and make sure that one of the working mysql libraries first? I tried this. It didn't work, but maybe I was doing something wrong? $ gem which mysql (checking gem mysql-2.7 for mysql) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb I'm not sure how you ended up with a mysql.rb in your lib/ruby/1.8, but that's the pure ruby driver. You should be using the mysql or mysqlplus gem instead, which has a C extension driver. Aman $ export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/mysql.rb $ echo $RUBYLIB /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ sequel mysql://localhost/castle_gameserver?user=root Error: Sequel::DatabaseConnectionError: NameError uninitialized constant Mysql::CLIENT_MULTI_RESULTS/Library/Ruby/Gems/1.8/gems/ sequel-3.1.0/lib/sequel/adapters/mysql.rb:97:in `connect' Also, try this from irb (without requiring any mysql stuff explicitly): require 'sequel' rescue nil p $: That should give an indication of what mysql library sequel is loading. $ irb require 'sequel' rescue nil = true p $: [/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb, /Library/Ruby/Gems/1.8/gems/sequel-3.1.0/bin, / Library/Ruby/Gems/1.8/gems/sequel-3.1.0/lib, /Library/Ruby/Site/ 1.8, /Library/Ruby/Site/1.8/powerpc-darwin9.0, /Library/Ruby/Site/ 1.8/universal-darwin9.0, /Library/Ruby/Site, /System/Library/ Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8, /System/ Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ powerpc-darwin9.0, /System/Library/Frameworks/Ruby.framework/ Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0, .] = nil :( Any other ideas? All I want to do is be able to run migrations. Is there some way to do that from within irb? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sequel-talk group. To post to this group, send email to sequel-talk@googlegroups.com To unsubscribe from this group, send email to sequel-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~--~~~~--~~--~--~---
Re: sequel command line tool: fail
Aman, Jeremy, thanks so much! I deleted that mysql.rb file, and migrations are running quite nicely from both the command line utility and from within irb as well now. I have *other* problems now, but at least this one is solved. Cheers! -Steve On Jul 2, 1:59 pm, Aman Gupta themastermi...@gmail.com wrote: On Thu, Jul 2, 2009 at 1:58 PM, Steve Hp.wi...@gmail.com wrote: Ahh! Aman to my rescue. Glad you're on this list as well as the EM one :) Yes, I installed the pure ruby mysql driver back when I had accidentally downloaded and installed MySQL x86_64, and my connection was super slow so I didn't replace it with x86 right away. I installed the pure ruby mysql gem manually (like an idiot). How can I now uninstall it? If I simply remove that mysql.rb file, will that work? Removing the file should work, you can also see if there's a mysql directory in there you need to delete. Also the migrator was moved to an extension, simply require 'sequel/extensions/migration' Aman Thanks for the help guys... -Steve On Jul 2, 1:35 pm, Aman Gupta themastermi...@gmail.com wrote: On Thu, Jul 2, 2009 at 12:08 PM, Steve Hp.wi...@gmail.com wrote: Jeremey, thanks so much for replying to my question! Does it also work with em-mysql (if not, it could be that sequel is trying to load that)? em-mysql isn't really a standalone mysql driver. It requires mysqlplus itself to work. Can you try using the RUBYLIB environment variable and make sure that one of the working mysql libraries first? I tried this. It didn't work, but maybe I was doing something wrong? $ gem which mysql (checking gem mysql-2.7 for mysql) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb I'm not sure how you ended up with a mysql.rb in your lib/ruby/1.8, but that's the pure ruby driver. You should be using the mysql or mysqlplus gem instead, which has a C extension driver. Aman $ export RUBYLIB=/System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/mysql.rb $ echo $RUBYLIB /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb $ sequel mysql://localhost/castle_gameserver?user=root Error: Sequel::DatabaseConnectionError: NameError uninitialized constant Mysql::CLIENT_MULTI_RESULTS/Library/Ruby/Gems/1.8/gems/ sequel-3.1.0/lib/sequel/adapters/mysql.rb:97:in `connect' Also, try this from irb (without requiring any mysql stuff explicitly): require 'sequel' rescue nil p $: That should give an indication of what mysql library sequel is loading. $ irb require 'sequel' rescue nil = true p $: [/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb, /Library/Ruby/Gems/1.8/gems/sequel-3.1.0/bin, / Library/Ruby/Gems/1.8/gems/sequel-3.1.0/lib, /Library/Ruby/Site/ 1.8, /Library/Ruby/Site/1.8/powerpc-darwin9.0, /Library/Ruby/Site/ 1.8/universal-darwin9.0, /Library/Ruby/Site, /System/Library/ Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8, /System/ Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ powerpc-darwin9.0, /System/Library/Frameworks/Ruby.framework/ Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0, .] = nil :( Any other ideas? All I want to do is be able to run migrations. Is there some way to do that from within irb? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sequel-talk group. To post to this group, send email to sequel-talk@googlegroups.com To unsubscribe from this group, send email to sequel-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~--~~~~--~~--~--~---
Re: sequel command line tool: fail
On Jun 30, 11:59 pm, Steve H p.wi...@gmail.com wrote: Hey everyone, I'm brand new to Sequel (as of like a few days ago). So far, I'm really kind of loving it!! I do wish the docs were a little better organized/more extensive, but it's hard to complain. At least there ARE docs. :D Anyway, I'm trying to use the sequel command line tool with my mysql database (on osx), and it's not working. Here's what I get: $ sequel mysql://localhost/castle_gameserver?user=root Error: Sequel::DatabaseConnectionError: NameError uninitialized constant Mysql::CLIENT_MULTI_RESULTS/Library/Ruby/Gems/1.8/gems/ sequel-3.1.0/lib/sequel/adapters/mysql.rb:97:in `connect' I do have mysql installed, but I also have mysqlplus and em-msql: $ gem list | grep mysql mysql (2.7) oldmoe-mysqlplus (0.1.1) tmm1-em-mysql (0.3.0) Could these other mysql gems be causing problems? Other mysql things seem to be working fine (I tried rake db:create and rake db:migrate in an old Rails project, it worked fine). It looks like the mysql library sequel attempted to use doesn't support CLIENT_MULTI_RESULTS. I'm just a bit concerned because I originally installed Mysql Server x86_64, which (as you may know) will not work on OSX with the regular mysql gem. So I installed Mysql Server x86 over it, and everything appears to work fine (a la rake tasks mentioned above, which would not work when x86_64 was installed). The funniest thing here is if I jump into irb, require mysql and sequel (or even mysqlplus and sequel), everything works fine. What gives?? It is odd that it would work in irb but the sequel command itself would not work. Does it also work with em-mysql (if not, it could be that sequel is trying to load that)? Can you try using the RUBYLIB environment variable and make sure that one of the working mysql libraries first? Also, try this from irb (without requiring any mysql stuff explicitly): require 'sequel' rescue nil p $: That should give an indication of what mysql library sequel is loading. Jeremy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sequel-talk group. To post to this group, send email to sequel-talk@googlegroups.com To unsubscribe from this group, send email to sequel-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~--~~~~--~~--~--~---