Problems after updating from rubygems 1.3.5

Purvez's Avatar

Purvez

23 Sep, 2011 07:05 AM

I'm currently on Ubuntu 10.04 with ruby 1.8 and rails 2.3.8. My web server is Apache2 and Phusion Passenger. Yesterday I tried the following

  1. To install a gem 'whenever' but it required a rubygems version >= 1.3.6.
  2. I checked my version using gem -v and it was at 1.3.5
    3, So I tried to update using gem update --system. However I got a message to say that this was not supported on debian and ubuntu.
  3. I therefore tried gem install rubygems-update followed by rubygems.
  4. That appeared to work because I could then run gem install 'whenever' and it installed. Also gem -v shows that I'm now on version 1.8.10.
  5. Then the problems started. I can no longer run script/console or start my app. I get a message saying that I need to install Rails 2.3.8 gem.
  6. Using gem env I find that my INSTALLATION DIRECTORY is /usr/lib/ruby/gems/1.8. However most of my gems (including rails 2.3.8) are sitting in /var/lib/gems/1.8. I'm guessing that step 4 above created a new rubygems set and now everything is pointing there.
  7. I read that symlinks might solve the problem so I renamed /usr/lib/ruby/gems to /usr/lib/ruby/gemsx and then ran ln -s /var/lib/gems /usr/lib/ruby/gems. However that still does not solve my problem.

Please help me to get back to the point where rubygems is looking at the right installation directory again.

Thanks

Purvez

  1. 2 Posted by Purvez on 23 Sep, 2011 07:55 AM

    Purvez's Avatar

    I have a small update to the above. I found the following :

    http://rudygems.com/post/164224985/update-rubygems-on-ubuntu

    This said to run update_rubygems from /var/lib/gems/1.8/bin which I did and now my app has started to work. However when I try script/console I get tons of deprecation warnings along the lines of :
    Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. and then for sub commands within Gem::SourceIndex.

    Looking at gem env the INSTALLATION DIRECTORY is still /usr/lib/ruby/gems/1.8 but now the symlink appears to be working. However it now appears that version 1.8.10 of rubygems is not liking the older gems. Please can someone tell me how to go back to rubygems 1.3.6.

    Thanks
    Purvez

  2. 3 Posted by purvez on 23 Sep, 2011 08:26 AM

    purvez's Avatar

    The problem with script/console is a bit more than just deprecation warnings. After all the deprecation warnings it gives the following :

    Gem::SourceIndex#initialize called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/vendor_gem_source_index.rb:100.
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55:NameError: uninitialized constant ActiveSupport::Dependencies::Mutex /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55:NameError: uninitialized constant ActiveSupport::Dependencies::Mutex /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/console_with_helpers.rb:5:NameError: uninitialized constant ApplicationController

    This then causes the development environment to not load so I still can't use console.

    Purvez

  3. Support Staff 4 Posted by Nick Quaranto on 23 Sep, 2011 03:23 PM

    Nick Quaranto's Avatar

    :( This is messed up. Debian's ruby/rubygems always cause problems, sadly. Can you try installing a fresh ruby with RVM?

    http://beginrescueend.com/

  4. 5 Posted by Purvez on 23 Sep, 2011 03:36 PM

    Purvez's Avatar

    Hi Nick

    Thanks for the response. I was worried you might say that. Please can you tell me some more:

    1. If I install a fresh ruby with RVM will I also have to re-install all the gems that I had already installed, starting with rails?

    2. How will the new ruby sit with my existing app?

    3. Should I be uninstalling something before starting with RVM? I currently don't have RVM at all on the machine.

    I'm quite close to delivering on a project and don't want to find myself with problems at this stage?

    One thing I am intriqued about is why the app now works but the console still fails? What is different in the way the 2 are loaded?

    I appreciate your help and your responses to the above will help me in getting back on the straight and narrow.

    Purvez

  5. Support Staff 6 Posted by Nick Quaranto on 23 Sep, 2011 07:41 PM

    Nick Quaranto's Avatar
    1. Yes.

    2. No idea how your system configuration is. I use heroku whenever possible since this kind of sysadmin stuff does nothing but kill time for me :)

    3. RVM works in your user's home directory (~/.rvm) so you shouldn't have to.

    I would definitely at least try to update RubyGems. gem update --system should work.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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