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@googlegroups.com.
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.

Search Discussions

  • Frederick Cheung at Apr 3, 2012 at 9:58 pm

    On Apr 3, 10:48 pm, "Miguel A." 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.yml
    what 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@googlegroups.com.
    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.
  • Miguel A. at Apr 3, 2012 at 10:06 pm

    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@googlegroups.com.
    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.
  • Frederick Cheung at Apr 3, 2012 at 10:12 pm

    On Apr 3, 11:06 pm, "Miguel A." 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@googlegroups.com.
    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.
  • Miguel A. at Apr 3, 2012 at 10:24 pm

    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

    Thank 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@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedApr 3, '12 at 9:48p
activeApr 3, '12 at 10:24p
posts5
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Miguel A.: 3 posts Frederick Cheung: 2 posts

People

Translate

site design / logo © 2021 Grokbase