no such file to load -- rubygems/commands/migrate

grigio's Avatar

grigio

06 Mar, 2010 10:29 AM

$ sudo gem 11:25 /usr/lib/ruby1.9/gems/1.9.0/gems/gemcutter-0.5.0/lib/gemcutter.rb:4:in require': no such file to load -- rubygems/commands/migrate (LoadError) 11:25 from /usr/lib/ruby1.9/gems/1.9.0/gems/gemcutter-0.5.0/lib/gemcutter.rb:4:inblock in '

  1. Support Staff 2 Posted by Nick Quaranto on 06 Mar, 2010 03:09 PM

    Nick Quaranto's Avatar

    Hi there, what's your gem env output look like? This seems to work fine for me with 1.9.1...

    gem master % gem migrate
    This command is deprecated, RubyForge accounts/ownerships have been transferred to Gemcutter.
    Please see http://rubygems.org/pages/migrate for more information
    gem master % gem -v
    1.3.6
    gem master % ruby -v
    ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin9.8.0]
    
  2. 3 Posted by grigio on 06 Mar, 2010 11:39 PM

    grigio's Avatar

    $ gem -v 1.3.6
    grigio@grigio-desktop:/usr/bin$ gem help commands
    /usr/local/lib/site_ruby/1.9.1/rubygems/command_manager.rb:169:in `require': no such file to load -- rubygems/commands/exec_command (LoadError)

    from /usr/local/lib/site_ruby/1.9.1/rubygems/command_manager.rb:169:in `rescue in load_and_instantiate'
    

    $ gem env RubyGems Environment:
    - RUBYGEMS VERSION: 1.3.6 - RUBY VERSION: 1.9.1 (2010-01-10 patchlevel 378) [x86_64-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby1.9/gems/1.9.0 - RUBY EXECUTABLE: /usr/bin/ruby1.9.1 - EXECUTABLE DIRECTORY: /usr/lib/ruby1.9/gems/1.9.0/bin - RUBYGEMS PLATFORMS:

    - ruby
    - x86_64-linux
    
  3. 4 Posted by Tyler Rick on 09 Mar, 2010 06:06 AM

    Tyler Rick's Avatar

    This was affecting me too. I was getting that error when I did ANYTHING with the gem command, rendering it completely unusable. I couldn't even gem uninstall gemcutter

    > sudo gem uninstall gemcutter
    /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0/lib/gemcutter.rb:4:in `require': no such file to load -- rubygems/commands/migrate (LoadError)
        from /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0/lib/gemcutter.rb:4:in `block in '
        from /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0/lib/gemcutter.rb:3:in `each'
        from /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0/lib/gemcutter.rb:3:in `'
        from /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0/lib/rubygems_plugin.rb:1:in `require'
        from /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0/lib/rubygems_plugin.rb:1:in `'
        from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:1113:in `load'
        from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:1113:in `block in '
        from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:1105:in `each'
        from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:1105:in `'
        from /usr/bin/gem:8:in `require'
        from /usr/bin/gem:8:in `'
    

    My workaround:

    sudo mv /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0 /usr/lib/ruby1.9.1/gems/1.9.1/gems/Xgemcutter-0.5.0
    
    > gem env
    RubyGems Environment:
      - RUBYGEMS VERSION: 1.3.6
      - RUBY VERSION: 1.9.1 (2009-07-16 patchlevel 243) [x86_64-linux]
      - INSTALLATION DIRECTORY: /usr/lib/ruby1.9.1/gems/1.9.1
      - RUBY EXECUTABLE: /usr/bin/ruby1.9.1
      - EXECUTABLE DIRECTORY: /usr/bin
      - RUBYGEMS PLATFORMS:
        - ruby
        - x86_64-linux
      - GEM PATHS:
         - /usr/lib/ruby1.9.1/gems/1.9.1
         - /home/tyler/.gem/ruby/1.9.1
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :benchmark => false
         - :backtrace => true
         - :bulk_threshold => 1000
         - :sources => ["http://gems.rubyforge.org/", "http://gemcutter.org"]
         - "gem" => "--no-rdoc"
      - REMOTE SOURCES:
         - http://gems.rubyforge.org/
         - http://gemcutter.org
    
  4. 5 Posted by Niko on 09 Mar, 2010 10:55 AM

    Niko's Avatar

    Thanks this worked for me, too. Great.

  5. Support Staff 6 Posted by Nick Quaranto on 09 Mar, 2010 01:55 PM

    Nick Quaranto's Avatar

    I don't understand how this is possible...

    /tmp % gem fetch gemcutter
    Downloaded gemcutter-0.5.0
    /tmp % gem unpack gemcutter-0.5.0.gem 
    Unpacked gem: '/private/tmp/gemcutter-0.5.0'
    /tmp % ls gemcutter-0.5.0/lib/rubygems/commands 
    migrate.rb      tumble.rb       webhook.rb      yank.rb
    

    Can you unpack the gemcutter gem you mv'd and see if that's the same?

  6. 7 Posted by Tyler Rick on 09 Mar, 2010 06:09 PM

    Tyler Rick's Avatar

    Yes, their contents look identical--

    > ls /usr/lib/ruby1.9.1/gems/1.9.1/gems/Xgemcutter-0.5.0/lib/rubygems/commands/
    migrate.rb  tumble.rb  webhook.rb  yank.rb
    
    > sudo gem unpack gemcutter-0.5.0.gem 
    Unpacked gem: '/tmp/gemcutter-0.5.0'
    
    > diff -r /tmp/gemcutter-0.5.0 /usr/lib/ruby1.9.1/gems/1.9.1/gems/Xgemcutter-0.5.0
    [no differences]
    

    Hmm, I might have found something (I'm not sure)...
    I added this line to /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0/lib/gemcutter.rb:

    %w[migrate tumble webhook yank].each do |command|
      p $LOAD_PATH.grep(/gemcutter/)
      require "rubygems/commands/#{command}"
      Gem::CommandManager.instance.register_command command.to_sym
    end
    

    And it was giving me this:
    ["/var/lib/gems/1.9.1/gems/gemcutter-0.2.1/lib"]

    That is where rubygems was located before I upgraded to Rubygems 1.3.6 yesterday. But I have no idea why it would be in the $LOAD_PATH now. After the upgrade, for some unknown reason the gem path changed to /usr/lib/ruby1.9.1/gems/1.9.1 and I had to reinstall all my gems again. No problem, until I installed gemcutter.

    So I don't know why or how it was getting that in the $LOAD_PATH. (You saw for yourself it wasn't mentioned in my gem env output.) ... Anyway, I just moved that dir out of the way so it "should" no longer be a variable:

    sudo mv /var/lib/gems /var/lib/gems_before_upgrade_to_1.3.6
    

    And now when I run gem, it doesn't list any gemcutter paths

    > gem list
    []
    /usr/lib/ruby1.9.1/gems/1.9.1/gems/gemcutter-0.5.0/lib/gemcutter.rb:5:in `require': no such file to load -- rubygems/commands/migrate (LoadError)
    

    This is the complete value of $LOAD_PATH:

    ["/usr/local/lib/site_ruby/1.9.1",
     "/usr/local/lib/site_ruby/1.9.1/x86_64-linux",
     "/usr/local/lib/site_ruby",
     "/usr/lib/ruby/vendor_ruby/1.9.1",
     "/usr/lib/ruby/vendor_ruby/1.9.1/x86_64-linux",
     "/usr/lib/ruby/vendor_ruby",
     "/usr/lib/ruby/1.9.1",
     "/usr/lib/ruby/1.9.1/x86_64-linux",
     "."]
    

    Is something wrong there? Can someone please post what $LOAD_PATH is for them at this point?

  7. 8 Posted by Tyler Rick on 10 Mar, 2010 12:10 AM

    Tyler Rick's Avatar

    Well, I've given up on 1.3.6 for now. Not only was it having the problem described here, but it seemed that everywhere there was a require 'gem_name', it was failing to find that gem. I had to add a line above it with gem 'gem_name'. This breaking a lot of things and I couldn't take it any more, so I reverted everything back to 1.3.5.

    I imagine that I could have solved this particular problem for me by simply doing this:

    %w[migrate tumble webhook yank].each do |command|
      gem 'gemcutter'
      require "rubygems/commands/#{command}"
      Gem::CommandManager.instance.register_command command.to_sym
    end
    

    but I didn't think to try it before I reverted.

    I wish I knew why my $LOAD_PATH stopped being auto-populated with all my gems' paths when I upgraded to 1.3.6. But I guess that's another bug for another bug report for another time.

    Good luck everyone!

  8. Support Staff 9 Posted by Eric Hodel on 10 Mar, 2010 01:14 AM

    Eric Hodel's Avatar

    Sounds like you originally had Debian or Ubuntu RubyGems installed then upgraded with real RubyGems. The two versions are not compatible and cannot be interchanged.

    Unfortunately Debian and Ubuntu will neither contribute patches to RubyGems nor use RubyGems features that will allow this to Just Work as it should.

  9. 10 Posted by Tyler Rick on 10 Mar, 2010 01:49 AM

    Tyler Rick's Avatar

    You are right, I had Ubuntu RubyGems.

    When I tried sudo gem update --system, it told me that wasn't allowed, so I did this instead:

    sudo gem install rubygems-update-1.3.6.gem
    sudo update_rubygems
    

    I can see why you say the two versions are not compatible. I guess I found that out the hard way.

    That's unfortunate that Ubuntu/Debian don't play nice. I wish it were otherwise.

    And next time I will be sure to remove all traces of Ubuntu's version and then do a completely fresh install from source instead of trying to upgrade.

  10. 11 Posted by Dan Croak on 28 Mar, 2010 11:40 PM

    Dan Croak's Avatar

    I'm seeing the same problem. I'm on OS X Snow Leopard. My output to gem -v and gem migrate looks the same as Nick.

    Today, I installed rvm and Ruby 1.9.1 today. I was able to sudo gem install four or five gems but now I see this behavior. It started happening right after I tried to use grb (git_remote_branch), which ran from /usr/bin/grb and then said it couldn't find RubyGem git_remote_branch (>= 0) (Gem::LoadError). Now I am unable to sudo gem install anything.

  11. 12 Posted by Tom Preston-Werner on 04 Apr, 2010 01:09 AM

    Tom Preston-Werner's Avatar

    I just saw this same problem after install ruby 1.9.1 via rvm. I was able to install a few gems before gemcutter started failing. Moving gemcutter out of the way allowed me to continue my work.

    RubyGems Environment:
      - RUBYGEMS VERSION: 1.3.6
      - RUBY VERSION: 1.9.1 (2010-01-10 patchlevel 378) [i386-darwin10.2.0]
      - INSTALLATION DIRECTORY: /Users/tom/.rvm/gems/ruby-1.9.1-p378
      - RUBY EXECUTABLE: /Users/tom/.rvm/rubies/ruby-1.9.1-p378/bin/ruby
      - EXECUTABLE DIRECTORY: /Users/tom/.rvm/gems/ruby-1.9.1-p378/bin
      - RUBYGEMS PLATFORMS:
        - ruby
        - x86-darwin-10
      - GEM PATHS:
         - /Users/tom/.rvm/gems/ruby-1.9.1-p378
         - /Users/tom/.rvm/gems/ruby-1.9.1-p378%global
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :benchmark => false
         - :backtrace => false
         - :bulk_threshold => 1000
         - :sources => ["http://gemcutter.org", "http://gems.rubyforge.org", "http://gems.github.com/", "http://gems.github.com"]
         - "gemcutter_key" => "09a201869ba9a4ce56ad8ef6863e9a5b"
      - REMOTE SOURCES:
         - http://gemcutter.org
         - http://gems.rubyforge.org
         - http://gems.github.com/
         - http://gems.github.com
    
  12. Support Staff 13 Posted by John Barnette on 04 Apr, 2010 01:27 AM

    John Barnette's Avatar

    Tom, are you on OS X too? 10.6?

  13. 14 Posted by Tom Preston-Werner on 04 Apr, 2010 01:53 AM

    Tom Preston-Werner's Avatar

    Yes, OSX 10.6. rvm 0.1.18.

  14. 15 Posted by Dan Croak on 06 Apr, 2010 04:12 PM

    Dan Croak's Avatar

    Was back on 1.9.1 today to check out a bug report, and my temporary solution to the problem was just:

    sudo rm -rf /Users/lawless/.rvm/gems/ruby-1.9.1-p378/gems/gemcutter-0.5.0

    Now I'm able to use the "gem" command again.

  15. 16 Posted by David Lee on 08 Apr, 2010 08:31 AM

    David Lee's Avatar

    Also on OS X SL and rvm 0.1.22 here.

    I edited ~/.rvm/gems/ruby-1.9.1-p378/gems/gemcutter-0.5.0/lib/gemcutter.rb and added this line before the .each { ... require } block:

    $:.unshift File.dirname(FILE)

    Which fixed it for me ...

  16. Support Staff 17 Posted by Nick Quaranto on 17 Jul, 2010 08:16 PM

    Nick Quaranto's Avatar

    I'm not seeing this with 1.9.2 and gemcutter 0.6.0. If anyone else can provide a reproducible test case with it still happening let me know!

  17. Nick Quaranto closed this discussion on 17 Jul, 2010 08:16 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

29 Aug, 2014 06:23 PM
28 Aug, 2014 07:18 PM
27 Aug, 2014 12:03 PM
26 Aug, 2014 07:09 PM
26 Aug, 2014 07:07 PM