开发者

Ruby gem installation issue

I'm trying to install gems on my ruby installation... I've installed a few, like heroku, yet when i list my local gems, the only one i see is Rake, and of course heroku cannot be used...

Any idea how i can solve this? What could the issue be? Installation for Heroku gem sewems to go smooth using sudo gem install heroku...

here is my gem environment:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.6
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i686-linux]
  - INSTALLATION DIRECTORY: /home/alex/.rvm/gems开发者_JAVA百科/ruby-1.9.2-p290
  - RUBY EXECUTABLE: /home/alex/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /home/alex/.rvm/gems/ruby-1.9.2-p290/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/alex/.rvm/gems/ruby-1.9.2-p290
     - /home/alex/.rvm/gems/ruby-1.9.2-p290@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Thx!


I see that you use rvm to maintain your gems. Please do not use sudo to install the gems in that case.


RVM doesn't recognize gems installed with sudo and seems to be buggy even when you aren't using the sudo installed gems.

The ultimate solution that worked for me to uninstall all the gems locally and with sudo. Here is what to do:

  1. $sudo gem list and $gem list to grab the gems you want. Save those as a .gems file using a text editor. The .gems file is just a listing of the gems, one per line, with the version number after (e.g. nokogiri -v1.4.3.1)

  2. uninstall all of the gems. You can do this in bulk by just listing the gems with a space separated between them. $sudo gem uninstall gem1 gem2 gem3

  3. use the directions at https://rvm.beginrescueend.com/gemsets/importing/ to import the newly made .gems list.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜