Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#3863

Rake gives me output like it doesn't understand .gemspec files when trying to run

$ rake -T

On a newly generated rails3.0.0.beta app.

The output is in the attachment.

leto:rails oivanovski$ ruby1.9 -v
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10]

leto:rails oivanovski$ rake --version
rake, version 0.8.7

leto:rails oivanovski$ gem1.9 --version
1.3.5

Reported by Ognen Ivanovski · February 5th, 2010 @ 03:42 PM

State: duplicate
Milestone: 3.0.2
Assigned to: Yehuda Katz (wycats) Yehuda Katz (wycats)
Importance: Low

Activity

  1. MOE
    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)

    February 6th, 2010 @ 06:20 AM

  2. José Valim
    José Valim
    • Assigned user set to Yehuda Katz (wycats)

    February 6th, 2010 @ 10:06 AM

  3. José Valim
  4. trevor
    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.beta
    

    seeing 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_PATTERNS
    

    whenever starting rails with rails server or rails console

    February 6th, 2010 @ 07:49 PM

  5. Balazs Nagy
    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
    

    February 7th, 2010 @ 02:40 PM

  6. Balazs Nagy
    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.

    February 8th, 2010 @ 02:03 PM

  7. Jeremy Kemper
    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.

    February 8th, 2010 @ 07:43 PM

  8. trevor
    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
    

    February 8th, 2010 @ 10:36 PM

  9. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM