Search code examples
ubunturubygemsrvmruby-1.9

ruby-1.9.2-head gem usage issues


I've been having difficulty with running gem commands with ruby 1.9.x and any version of rubygems. I've been using rvm to handle all the installation of ruby and rubygems, but I can't seem to isolate the issue:

rvm use 1.8.7
Using /home/kelly/.rvm/gems/ruby-1.8.7-p352
which gem
/home/kelly/.rvm/rubies/ruby-1.8.7-p352/bin/gem
gem -v
1.8.10
gem install rails #success!

rvm use 1.9.2
Using /home/kelly/.rvm/gems/ruby-1.9.2-p290
which gem
/home/kelly/.rvm/rubies/ruby-1.9.2-p290/bin/gem
gem -v
1.8.10
gem install rails
ERROR:  While executing gem ... (NoMethodError)
    undefined method `each' for "http://rubygems.org":String

I'm running a 64-bit Ubuntu 11.04 install. Any pointers?


Solution

  • After editing my ~/.gemrc configuration file to specify source instead of sources, rubygems was able to load my sources as an Array instead of a String:

    before

    ---
    :backtrace: false
    :benchmark: false
    :bulk_threshold: 1000
    :sources: http://rubygems.org
    :update_sources: true
    :verbose: true
    

    after

    ---
    :backtrace: false
    :benchmark: false
    :bulk_threshold: 1000
    :source: http://rubygems.org
    :update_sources: true
    :verbose: true