Wednesday, September 15, 2010

confusion of many gem environments

In this article, I installed many Ruby languages on my Macmini. But Confusion of many gem environments occurs. It's the conflict about Ruby1.8's and Ruby 1.9's

$ gem1.9 outdated
/opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/source_index.rb:68:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/source_index.rb:58:in `from_installed_gems'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems.rb:883:in `source_index'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:13:in `initialize'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems.rb:841:in `new'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems.rb:841:in `block in searcher'
    from :10:in `synchronize'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems.rb:840:in `searcher'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems.rb:479:in `find_files'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems.rb:983:in `load_plugins'
    from /opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems.rb:1139:in `'
    from :29:in `require'
    from :29:in `require'
    from /usr/bin/gem:8:in `
'

It's the bug reported in Debian (see the report) and it may occurs in Mac OS X too. Temporary solution for this bug is, edit the shebang.
$ sudo vi `which gem1.9`
#!/opt/local/bin/ruby1.9 --disable-gems
...
$ gem1.9 outdated
mail (2.2.5 < 2.2.6.1)

That's okay.

No comments:

Post a Comment