Forum: Ruby on Rails Rails requires RubyGems >= 1.1.1 : problem

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.
Thomas B. (Guest)
on 2008-11-07 12:16
(Received via mailing list)
Hello,
On my local machine (Mac OS X 10.5.5), I get the following error when I
try
to run script/server start :
"Rails requires RubyGems >= 1.1.1 (you have 1.0.1). Please `gem update
--system` and try again."

The Rails app was a former 1.2.6 upgraded to 2.1, and it worked fine.
I've run the rake rails:update command.

If I create a new Rails app, it starts with the command script/server
start
without complaining.

I've run :
sudo gem update --system
Updating RubyGems
Nothing to update

Some infos :
* gem -v
1.3.1
* which gem
/usr/local/bin/gem
* ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.5.1]
* which ruby
/usr/local/bin/ruby
* rails -v
Rails 2.1.2
* which rails
/usr/local/bin/rails
* gem list
*** LOCAL GEMS ***

actionmailer (2.1.2, 2.1.0, 1.3.6)
actionpack (2.1.2, 2.1.0, 1.13.6)
actionwebservice (1.2.6)
 activerecord (2.1.2, 2.1.0, 1.15.6)
activeresource (2.1.2, 2.1.0)
activesupport (2.1.2, 2.1.0, 1.4.4)
capistrano (2.5.0)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
highline (1.4.0)
mongrel (1.1.5)
mysql (2.7)
net-scp (1.0.1)
net-sftp (2.0.1)
net-ssh (2.0.4)
net-ssh-gateway (1.0.0)
rails (2.1.2, 2.1.0, 1.2.6)
rake (0.8.3)
rubygems-update (1.3.1)

Any idea?
Thanks in advance for your help.

Best,
Thomas.
Rick (Guest)
on 2008-11-08 23:10
(Received via mailing list)
Check the file config/environment.rb in your application's directory
tree.  It will have a line like:

RAILS_GEM_VERSION = '2.2.0' unless defined? RAILS_GEM_VERSION

Change the RAILS_GEM_VERSION to match yours, 2.1.2, and restart your
script/server.

Rick
Freddy A. (Guest)
on 2008-11-09 00:18
(Received via mailing list)
Just a wild guess but you have installed the ports version of ruby
1.8.7 which is not the default ruby install on osx. Gems are installed
and stored under the ruby install that it was installed with.. Which
means if you installed all the gems in one ruby then added the ports
ruby you need to reinstall your gems...

You script/server might be getting some old path info... ?? I know
when I upgraded to 1.8.7 on the mac I had very similar issues...
Thomas B. (Guest)
on 2008-11-09 13:31
(Received via mailing list)
Hello Rick,
Thanks for your help.
I already have this line in my environment.conf "RAILS_GEM_VERSION =
'2.1.2'
unless defined? RAILS_GEM_VERSION".

But I still get the same "Rails requires RubyGems >= 1.1.1 (you have
1.0.1).
Please `gem update --system` and try again." error.

Thomas.
Thomas B. (Guest)
on 2008-11-09 13:32
(Received via mailing list)
Hello Freddy,
Thanks for your guess, but I compiled ruby manually, following Dan
Benjamin's instructions found here :
http://danbenjamin.com/articles/2008/02/ruby-rails-leopard

Thomas.
Rick (Guest)
on 2008-11-09 19:07
(Received via mailing list)
ok,

So the "Rails requires..." message is comming from ".../gems/1.8/gems/
rails-2.1.2/environments/boot.rb" which will also force a load from
"vendor/rails" if you have one.

Did you freeze rails into your app by any chance?

Rick
Thomas B. (Guest)
on 2008-11-10 10:41
(Received via mailing list)
Hello Rick,
My app wasn't frozen.
I froze it to 2.1.2 and script/server start now works.

Thanks for your help.

Still, I don't understand why it didn't worked without the freeze.

Best,
Thomas.
元明 é. (Guest)
on 2008-11-11 02:41
Excuse me. I'm caught in a similar problem.
thank you for the hints so far.

But symptom at my hands has a great difference to Balthazar-san's one;
"gem -v" returns 1.1.0,
and it sticks whatever I've done(have downloaded rubygems-1.3.1 and let
steup.rb run).

> I froze it to 2.1.2 and script/server start now works.

So I don't get success in freezing: the same error message comes up!
when try freezing.

Won't you please give some further hints?
I guess "gem -v" should be to return 1.3.1 somehow...

====

SHINDO Motoaki@Yonago, Japan

====
Thomas B. (Guest)
on 2008-11-12 11:32
(Received via mailing list)
Hello,
Did you try to run 'gem update --system'?
Which OS are you running?

Best,
Thomas.
元明 é. (Guest)
on 2008-11-13 13:45
HI

> Did you try to run 'gem update --system'?

Of Course I did. and got "nothing to update".

> Which OS are you running?

Mac OS X 10.5.5 as yours (^_^;)
I wonder ones with other platforms haven't come across the problem...

Best.
元明 é. (Guest)
on 2008-11-16 03:47
> I guess "gem -v" should be to return 1.3.1 somehow...

At last I found
http://docs.rubygems.org/read/chapter/15#page101
tells "GEM_HOME should point to $PREFIX/lib/ruby/gems/1.8 if it used
with the 1.8 version of ruby."
and that kind of settings now makes all  OK.
"gem -v" now returns 1.3.1 and script/server starts WEBrick.

I used to use /usr/local/rubygems/ of gem install dir,
 according to the default setting of gem (of former version).
I damn that setting!
 I also find the default is now /usr/local/lib/ruby/gems/1.8 under gem
of v1.3.1.

moto@Yonago, Japan
alberto (Guest)
on 2008-12-30 16:00
(Received via mailing list)
$ gem install rubygems-update
$ update_rubygems
This topic is locked and can not be replied to.