This project is archived and is in readonly mode.
Rails 3.0.0.beta / rake seems not to work well with rubygems 1.3.5 on ruby 1.9.1
-
MOE
Worked for me with no err with
moe@ingrid:/tmp/tryout$ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i486-linux]
moe@ingrid:/tmp/tryout$ rake --version
rake, version 0.8.7
moe@ingrid:/tmp/tryout$ rails -v
Rails 3.0.0.beta
moe@ingrid:/tmp/tryout$ gem -v
1.3.5
moe@ingrid:/tmp/tryout$ rake -T
(in /tmp/tryout) rake about # Explain the current environment
(blah blah) -
José Valim
- Assigned user set to Yehuda Katz (wycats)
-
José Valim
- Milestone cleared.
-
trevor
I posted the same problem for ticket 3865.
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets...% ruby -v ruby 1.9.2dev (2010-02-03 trunk 26544) [x86_64-darwin10.2.0] % rails -v Rails 3.0.0.betaseeing a lot of warnings along the lines -
WARNING: #<NoMethodError: undefined method '>' for nil:NilClass>
WARNING: Invalid .gemspec format in '/usr/local/lib/ruby/gems/1.9.1/specifications/warden-0.9.0.gemspec'
WARNING: #<NoMethodError: undefined method '>' for nil:NilClass>
WARNING: Invalid .gemspec format in '/usr/local/lib/ruby/gems/1.9.1/specifications/xml-simple-1.0.12.gemspec'and
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:14: warning: already initialized constant VERSION /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:14: warning: already initialized constant RubyGemsVersion /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:194: warning: already initialized constant MUTEX /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:196: warning: already initialized constant RubyGemsPackageVersion /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:202: warning: already initialized constant WIN_PATTERNSwhenever starting rails with
rails serverorrails console -
Balazs Nagy
I'm hunting this problem for a while too. Apparently it's fixed in bundler (instead of pointing to one other), in http://github.com/carlhuda/bundler/commit/9fbab6d5a19127d8ba209d981...
The problem is with multiple require of 'rubygems'. For the other, direct rubygems warnings, I have written the same patch for active_support. Oh, good ol' days of
#ifndef WHATEVER_H #define WHATEVER_H ... #endif -
Balazs Nagy
Hmm my bad. The problem lies in ruby itself:
ike:~>>% ruby -e 'puts $".grep(/rubygems/).inspect' ["/Users/js/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/rubygems.rb"]The pattern is .../lib/ruby/<version>/rubygems.rb. However, 1.3.5 is installed in another directory like .../lib/ruby/site_ruby/<version>/rubygems.rb.
Thus, if you remove the original rubygems.rb and it's rubygems dir (.../lib/ruby/<version>/rubygems*), the warnings will disappear.
-
Jeremy Kemper
- State changed from new to duplicate
If Gem is defined, the require would have worked, so this AS patch is unneeded. Thanks for the investigations, though.
-
trevor
as pointed out by Balazs Nagy the "warning: already initialized constant" comes from Ruby cruft. removing the old library directory and starting with a fresh install removes those warnings.
note, this does not fix the verbose "Invalid .gemspec format in" warnings.
here's approximately what I did on OS X (snow leopard).
gem list --no-version > gem_list.txt sudo mv /usr/local/lib/ruby /usr/local/lib/ruby-old wget ftp://ftp.ruby-lang.org/pub/ruby/snapshot.tar.bz2 # install sudo su gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n gem install rails --pre gem install sqlite3-ruby env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config # install remaining gems
