views:

74

answers:

3

I know this has been asked multiple times before, but I've tried those things and still am not having any luck.

For the mechanize gem, I keep getting the "Missing these required gems" error when I run db:migrate on my production server.

Here's the full error:

Missing these required gems:
  mechanize  

You're running:
  ruby 1.8.6.111 at /usr/bin/ruby1.8
  rubygems 1.3.5 at /home/user/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8

Output of which ruby is /usr/bin/ruby

Output of which gem is /usr/bin/gem

When I run gem list mechanize (1.0.0) is definitely in the list.

What am I doing wrong here?

A: 

There is a chance that you may require i different version of the mechanize gem. Try to work out what version of the gem its looking for.

thomasfedb
A: 

It's possible that you may require a different version, Try

rake gems:install
Rishav Rastogi
I've already done that...no luck.
Shpigford
A: 

What's the output of which rake?

The output of which ruby is /usr/bin/ruby, while the rake task reports /usr/bin/ruby1.8. Unless one is a symlink to the other, I suspect something is awry in your environment.

Also, looks like you have some gems installed in your user folder. Have you tried installed the gem system-wide with sudo gem install or sudo rake gems:install?

elektronaut
You can find out with `gem which mechanize`
Isaac Cambron