Rails can't find it's gems

Hi,

yesterday I attempted to test my Rails app with Ruby 1.9. I installed
all necessary gems, saw that some of them aren't compatible with 1.9 and
switched back to 1.8. Now my app still thinks it has to go with 1.9 and
shows the following error message when I try to test it.

---------8<---------------------------------------
$ rake test
(in /home/helge/Development/kunsthof)
Missing these required gems:
  mysql
  rmagick

You're running:
  ruby 1.9.1.243 at /usr/bin/ruby1.9.1
  rubygems 1.3.6 at /home/helge/.gem/ruby/1.9.1,
/usr/lib/ruby1.9.1/gems/1.9.1

Run `rake gems:install` to install the missing gems.
---------8<---------------------------------------

Apparently Rails always uses the most recent Ruby it can find. Can I
tell it to use 1.8 somehow?

I would expect it to use the first one in your path :slight_smile:

That would be the first thing to check, in any case...

Now I got it. Rake uses the Ruby specified in /usr/bin/rake's shebang
line. The 1.9 rake was the latest installed and so it used Ruby1.9. To
use Ruby1.8 I typed 'rake1.8'.

Now I got it. Rake uses the Ruby specified in /usr/bin/rake’s shebang

line. The 1.9 rake was the latest installed and so it used Ruby1.9. To

use Ruby1.8 I typed ‘rake1.8’.

I would recommend using RVM because it takes care of this quite nicely.

Thus, you can find more information about it here:

http://rvm.beginrescueend.com

Good luck,

-Conrad

Nice! Thank you!