如何在家庭目录中安装宝石?

时间:2013-06-08 12:36:53

标签: ruby rubygems gem home-directory

我在我的$HOME目录

中安装了宝石
$ cat .gemrc 
-----------------------------------
gemhome: ~/.gems

gempath: /usr/lib/ruby/gems/1.9.1
-----------------------------------

$ gem install rspec
installs rspec in ~/.gems/gems/rspec-*

$ gem list

*** LOCAL GEMS ***

diff-lcs (1.2.4)
rspec (2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.1)

$ rspec test_rspec.rb 
cant find rspec -- apparently its not in $PATH

$ gem uninstall rspec
INFO:  gem "rspec" is not installed
谁能帮助我吗?我没有使用rvm,我试图先了解这些工具。

感谢

更新:

env | grep GEM

什么都不返回

gem env

RubyGems环境:

  • RUBYGEMS版本:1.8.23
  • RUBY VERSION:1.9.3(2013-05-15 patchlevel 429)[i486-linux]
  • INSTALLATION DIRECTORY:〜/ .gems /
  • RUBY EXECUTABLE:/ usr / bin / ruby​​
  • EXECUTABLE DIRECTORY:〜/ .gems / bin
  • RUBYGEMS PLATFORMS:
    • 红宝石
    • x86的Linux的
  • GEM路径:
    • 〜/ .gems /
    • /usr/lib/ruby/gems/1.9.1~ / .gems /
  • GEM配置:
    • :update_sources =>真
    • :verbose =>真
    • :benchmark =>假
    • :backtrace =>假
    • :bulk_threshold => 1000
    • “gemhome”=> “〜/ .gems /”
    • “gempath”=> “/usr/lib/ruby/gems/1.9.1~ / .gems /”
  • 远程来源:

0 个答案:

没有答案