I decided to try out Rails 3 and immediately ran into big issues... I
am using ruby-1.8.7-p249 compiled with rvm on Ubuntu 9.10 and followed
the install instructions for Rails 3 from rails.info
My first issue was it required me to install the sqlite3-ruby gem
despite changing the adapters in config/database.yml. After trying to
find a way around this I gave up and just installed the extra gem.
After this, doing a rake db:create caused this error:
:~/rails_app$ rake db:create
(in -snip-/rails_app)
!!! Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql
The mysql gem is definitely installed, and correctly loads if I do the
following:
"Jonathan Nielsen" <mudwick@gmail.com> wrote in message news:46b884b7-c53a-4166-830b-82fdc7e5f5d7@z11g2000yqz.googlegroups.com...
Hi all,
I decided to try out Rails 3 and immediately ran into big issues... I
am using ruby-1.8.7-p249 compiled with rvm on Ubuntu 9.10 and followed
the install instructions for Rails 3 from rails.info
My first issue was it required me to install the sqlite3-ruby gem
despite changing the adapters in config/database.yml. After trying to
find a way around this I gave up and just installed the extra gem.
After this, doing a rake db:create caused this error:
:~/rails_app$ rake db:create
(in -snip-/rails_app)
!!! Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql
As I understand it, you need to add the mysql gem to the Gemfile, and run "bundle install". Rails 3 projects only look for gems in the .bundle directory. The bundler reads the gemfile, and then either creates links in the $appdir/.bundle directory to the system gems, or downloads them and installs them into the $appdir/.bundle directory. The whole idea is to allow installing gems that only one project needs into the project directory, rather than into the system gem repository, especally since the latter requires superuser permissions in many operating systems, but while doing so to use the system gems when possible to avoid duplication.
As I understand it, you need to add the mysql gem to the Gemfile, and run
"bundle install". Rails 3 projects only look for gems in the .bundle
directory.
Oh wow, I didn't see the gemfile at all... thanks for pointing me to
that. That looks like the solution to my problem, thanks!