Hello, I''m new to ror and i really like it so far! for a new application i would like to setup a ror application connecting to mysql but i can''t figure it out how. rails works fine with sqllite out the box but i need it working with mysql. these are my versions: -OSX snow leopard -ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] -Rails 3.0.0 $ /usr/local/mysql/bin/mysql : Server version: 5.1.51 MySQL Community Server (GPL) $ gem list: mysql (2.8.1) this is my development setting in config/database.yml development: adapter: mysql encoding: utf8 database: blog pool: 5 username: root password: socket: /tmp/mysql.sock Now when i test rake db:migrate i get the folowing error: daniels-macbook:blog daniel$ rails generate scaffold post name:string message:text // files created .... daniels-macbook:blog daniel$ rake db:migrate (in /sites/blog) rake aborted! !!! Missing the mysql gem. Add it to your Gemfile: gem ''mysql'', ''2.8.1'' (See full trace by running task with --trace) --------- The mysql 2.8.1 is already in my gem list and i have the gem installed with the command: sudo gem install mysql -- --with-mysql-config=/usr/ local/mysql/bin/mysql_config Does anyone know what i''m doing wrong? Thank you very much!! Greetings, Daniel -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
A shot in the dark, is the socket location correct? Try entering into mysql via command link using that socket. -sunny http://ezror.com On Oct 2, 4:23 am, Daniel Amsterdam <daniel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I''m new to ror and i really like it so far! for a new application i > would like to setup a ror application connecting to mysql but i can''t > figure it out how. rails works fine with sqllite out the box but i > need it working with mysql. these are my versions: > > -OSX snow leopard > -ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] > -Rails 3.0.0 > $ /usr/local/mysql/bin/mysql : Server version: 5.1.51 MySQL Community > Server (GPL) > $ gem list: mysql (2.8.1) > > this is my development setting in config/database.yml > > development: > adapter: mysql > encoding: utf8 > database: blog > pool: 5 > username: root > password: > socket: /tmp/mysql.sock > > Now when i test rake db:migrate i get the folowing error: > > daniels-macbook:blog daniel$ rails generate scaffold post name:string > message:text > // files created .... > daniels-macbook:blog daniel$ rake db:migrate > (in /sites/blog) > rake aborted! > !!! Missing the mysql gem. Add it to your Gemfile: gem ''mysql'', > ''2.8.1'' > > (See full trace by running task with --trace) > --------- > > The mysql 2.8.1 is already in my gem list and i have the gem installed > with the command: sudo gem install mysql -- --with-mysql-config=/usr/ > local/mysql/bin/mysql_config > > Does anyone know what i''m doing wrong? Thank you very much!! > > Greetings, Daniel-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> // files created ....> > daniels-macbook:blog daniel$ rake db:migrate > > (in /sites/blog) > > rake aborted! > > !!! Missing the mysql gem. Add it to your Gemfile: gem ''mysql'', > > ''2.8.1'' > > > > (See full trace by running task with --trace) > > --------- > > > > The mysql 2.8.1 is already in my gem list and i have the gem installed > > with the command: sudo gem install mysql -- --with-mysql-config=/usr/ > > local/mysql/bin/mysql_config > > > > Does anyone know what i''m doing wrong? Thank you very much!! > > >Did you put it in your gemfile? The gemfile is in the rails app root directory -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
The socket is ok, i use the socket in php and it works. I didn''t put the gem in the gem list (i didn''t know i had to do that so thank you for that) but when i put the gem in the list i get the error: rake db:migrate (in /sites/mysqlapp) rake aborted! undefined method `init'' for Mysql:Class The gem doesn''t work: $ irb>> require ''mysql'' => true>> db = Mysql.connect(''localhost'', ''root'', '''',''blog'')NoMethodError: undefined method `connect'' for Mysql:Class from (irb):2 when i google the "undefined method `init'' for Mysql:Class" error i found a lot of users with the same problem.. To bad i couldn''t find a working solution, i gues i have to stick to sqlite3. Greetings On 3 okt, 19:11, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > // files created .... > > > daniels-macbook:blog daniel$ rake db:migrate > > > (in /sites/blog) > > > rake aborted! > > > !!! Missing the mysql gem. Add it to your Gemfile: gem ''mysql'', > > > ''2.8.1'' > > > > (See full trace by running task with --trace) > > > --------- > > > > The mysql 2.8.1 is already in my gem list and i have the gem installed > > > with the command: sudo gem install mysql -- --with-mysql-config=/usr/ > > > local/mysql/bin/mysql_config > > > > Does anyone know what i''m doing wrong? Thank you very much!! > > Did you put it in your gemfile? > > The gemfile is in the rails app root directory-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Apparently Analagous Threads
- Advice needed --- Best way to get mysql2 gem installed to interact with Mysql Database?
- Error: uninitialized constant MysqlCompat::MysqlRes
- install Rails from terminal
- undefined method `get_client_info' for Mysql:Class
- Rails development processes running very slow