I''ve set up on Windows 7 Eclipse with ruby and radrails and want to use MySQL as a database. I''ve executed: gem install mysql2 And changed the database.yml I have tried to use MySQL 5.5 and 5.1 and the error still exists. rake aborted! Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.) I''ve also copia a libmysql dll into de ruby .bin folder. Any help? I have searched everywhere and cant get it fix. How and where in the gem file do I add what? On another note, if I have 2 tables, one with its primary key being a foreign key, does RoR automatically create a <columname_to> on that table? Thanks in advance, im stuck :/ Attachments: http://www.ruby-forum.com/attachment/7225/rake.jpg -- Posted via http://www.ruby-forum.com/. -- 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.
On Apr 3, 10:48 pm, "Miguel A." <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''ve set up on Windows 7 Eclipse with ruby and radrails and want to use > MySQL as a database. > I''ve executed: gem install mysql2 > And changed the database.ymlwhat did you change it to? I''d wager you''ve got adapter: mysql, whereas it should be adapter mysql2> Any help? I have searched everywhere and cant get it fix. > How and where in the gem file do I add what?Your Gemfile lists all the gems your app uses, if you''re using the mysql2 gem you''d need gem ''mysql2'' (If you''re using an older rails version you may need to specify a version of mysql2 that is compatible with your rails version.> > On another note, if I have 2 tables, one with its primary key being a > foreign key, does RoR automatically create a <columname_to> on that > table? >Not sure I quite get the question, but rails doesn''t create any columns automatically. Use a migration to add tables or change existing tables. There are a few shortcuts you can use in the migration / generators (e.g. rails g model1 model2:belongs_to will add a column called model2_id as well as an index) Fred> Thanks in advance, im stuck :/ > > Attachments:http://www.ruby-forum.com/attachment/7225/rake.jpg > > -- > Posted viahttp://www.ruby-forum.com/.-- 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.
> Your Gemfile lists all the gems your app uses, if you''re using the > mysql2 gem you''d need > > gem ''mysql2'' > > (If you''re using an older rails version you may need to specify a > version of mysql2 that is compatible with your rails version.Im using rails 3.2.2 na in my: C:\Ruby187\lib\ruby\gems\1.8\gems folder I can see the: mysql-2.8.1-x86-mingw32, mysql2-0.3.11-x86-mingw32 and mysql2-0.3.11-x86-mswin32-60 folders. Doesn''t this mean its installed already? :/ -- Posted via http://www.ruby-forum.com/. -- 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.
On Apr 3, 11:06 pm, "Miguel A." <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Im using rails 3.2.2 na in my: > C:\Ruby187\lib\ruby\gems\1.8\gems > > folder I can see the: > mysql-2.8.1-x86-mingw32, mysql2-0.3.11-x86-mingw32 and > mysql2-0.3.11-x86-mswin32-60 > > folders. > > Doesn''t this mean its installed already? :/Your rails app will only use the gems specified in your Gemfile (and their dependencies). If it''s not in your Gemfile, it''s not loaded, even if it is already installed Fred -- 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.
> Your rails app will only use the gems specified in your Gemfile (and > their dependencies). If it''s not in your Gemfile, it''s not loaded, > even if it is already installed > > FredThank you for the explanation and time dedicated Fred Best regards -- Posted via http://www.ruby-forum.com/. -- 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.