Forum: Ruby on Rails error: Rails requires RubyGems >= . Please install RubyGems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
David K. (Guest)
on 2008-12-21 19:50
In the directory of my rails app i run:

>>ruby script/console
Rails requires RubyGems >= . Please install RubyGems and try again:
http://rubygems.rubyforge.org

gem -v
1.3.1

gem list | grep rails
rails (2.2.2, 2.1.2)

gem list | grep rubygems
rubygems-update (1.3.1)

gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.1
  - RUBY VERSION: 1.8.4 (2005-12-24) [i586-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /root/.gem/ruby/1.8
   ...

ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

There is a mismatch between the Ruby version returned by 'gem
environment' and ruby --version
Anyone know if this is normal? I don't really know if this is causing
the problem

Other ideas?
Frederick C. (Guest)
on 2008-12-21 19:52
(Received via mailing list)
On 21 Dec 2008, at 17:50, David Kleman wrote:

>
> ruby --version
> ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
>
> There is a mismatch between the Ruby version returned by 'gem
> environment' and ruby --version
> Anyone know if this is normal? I don't really know if this is causing
> the problem
>
It probably is. I'd guess you have two parallel versions of ruby (one
in /usr/lib/ruby, the other probably in /usr/local/lib/ruby). One of
those has rubygems 1.3.1 installed, the other doesn't and you're
trying to run rails in the one that doesn't

Fred
Merrick J. (Guest)
on 2008-12-22 00:47
did you check your $PATH ? sounds like its calling the wrong executables
David K. (Guest)
on 2008-12-22 01:05
Merrick Johnson wrote:
> did you check your $PATH ? sounds like its calling the wrong executables

You're both right. There was two conflicting versions installed.
Fixing this led to some a chain of reinstallations but it's now fine and
I also got to learn a bunch of new gem commands:)

Thanks for your help in making me realising what the problem was.
Jonathan (Guest)
on 2009-01-25 18:28
(Received via mailing list)
On Dec 22 2008, 8:05 am, David Kleman <rails-mailing-l...@andreas-
s.net> wrote:
> Fixing this led to some a chain of reinstallations but it's now fine and
> I also got to learn a bunch of new gem commands:)

I'm getting the exact same error and can confirm I have the same
problem
(multiple versions of ruby and rubygems installed). Could you detail
how you
went about this "chain of reinstallations" to fix this problem? I'm
still
quite new to all this. FYI, I'm using Mac OS X 10.5.6.
Km H. (Guest)
on 2009-05-03 03:03
David Kleman wrote:
> Merrick Johnson wrote:
>> did you check your $PATH ? sounds like its calling the wrong executables
>
> You're both right. There was two conflicting versions installed.
> Fixing this led to some a chain of reinstallations but it's now fine and
> I also got to learn a bunch of new gem commands:)
>
> Thanks for your help in making me realising what the problem was.

Could you provide the steps too? Am facing the same problem.

thanks,
--kmhui
jeff leeman (Guest)
on 2009-06-03 22:53
(Received via mailing list)
Yea I'm having the exact same problem.  Can someone provide more
detail on how to solve this?

Thanks,
Jeff
David (Guest)
on 2009-06-13 12:34
(Received via mailing list)
I had installed ruby 1.8.7 from MacPorts and was also getting this
error.  After downloading RubyGems and running setup.rb, things worked
as expected.  I, of course, had to reinstall my gems since the new
RubyGems (/opt/local/bin/gem) keeps its gems in a different spot than
the gem that comes with Leopard (/usr/bin/gem).

All this is a little new to me but this is how I got it to work.
Memo M. (Guest)
on 2009-11-06 09:55
I was having this problem, after reading the insights from this thread,
I realised  running   "which gem" pointed to a certain directory, and
"which ruby"  pointed to a different directory.

I had a local ruby installation, and also a secondary installation under
/sw  that I had installed using fink, I just plain removed the
installation fink had put in (fink remove ruby), and after that
everything worked.
Derek L. (Guest)
on 2010-07-18 03:30
I had the same problem, and reason is also having two versions of ruby
installed. i working on OSX 10.6.4, but solution should apply for any
system if your problem has the same cause. Since I don't really use
macport, my solution is to removed reference to /opt/usr/local/bin from
my $PATH in ~/.bashrc. so in the end, i have the following line in my
~/.bashrc (removed some other misc stuff, but you get the idea):

export PATH="/usr/local/bin:/usr/local/lib:$PATH"

I suspect you'll be able to fix it by tweaking where you get your binary
in $PATH as well. hope this helps.

btw, I think David had to reinstall stuff because the location where he
pointed $PATH to doesn't have all the executables in the other location
he was running gem from.

Derek

Memo Memo wrote:
> I was having this problem, after reading the insights from this thread,
> I realised  running   "which gem" pointed to a certain directory, and
> "which ruby"  pointed to a different directory.
>
> I had a local ruby installation, and also a secondary installation under
> /sw  that I had installed using fink, I just plain removed the
> installation fink had put in (fink remove ruby), and after that
> everything worked.
This topic is locked and can not be replied to.