2012-11-08 30 views
-1

我在全局gemset中安裝了「pry」。但是我無法使用它。那是當我在我的代碼中使用「binding.pry」時,它說 - 無法解析'撬'。我嘗試過:require'pry'並加載'pry.rb',但沒有運氣。RVM - 無法使用全局gemset中的gem

<pre> 
[email protected]:/media/media1/railscode/beasport$ rvm gemset list 

gemsets for ruby-1.9.3-p194 (found in /home/nikhil/.rvm/gems/ruby-1.9.3-p194) 
    (default) 
=> beasport 
    composer_app 
    composer_app1 
    global 
    new_sample_app 

[email protected]:/media/media1/railscode/beasport$ gem which pry 
/home/nikhil/.rvm/gems/[email protected]/gems/pry-0.9.10/lib/pry.rb 
[email protected]:/media/media1/railscode/beasport$ gem list | grep pry 
pry (0.9.10) 
pry-debugger (0.2.0) 
pry-doc (0.4.4) 
pry-stack_explorer (0.4.7) 
[email protected]:/media/media1/railscode/beasport$ rvm info 

[email protected]: 

    system: 
    uname:  "Linux nikhil-K54C 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UTC 2012 i686 i686 i386 GNU/Linux" 
    system:  "ubuntu/12.04/i386" 
    bash:  "/bin/bash => GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu)" 
    zsh:   " => not installed" 

    rvm: 
    version:  "rvm 1.16.6 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]" 
    updated:  "1 month 5 days 1 hour 7 minutes 39 seconds ago" 

    ruby: 
    interpreter: "ruby" 
    version:  "1.9.3p194" 
    date:   "2012-04-20" 
    platform:  "i686-linux" 
    patchlevel: "2012-04-20 revision 35410" 
    full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]" 

    homes: 
    gem:   "/home/nikhil/.rvm/gems/[email protected]" 
    ruby:   "/home/nikhil/.rvm/rubies/ruby-1.9.3-p194" 

    binaries: 
    ruby:   "/home/nikhil/.rvm/rubies/ruby-1.9.3-p194/bin/ruby" 
    irb:   "/home/nikhil/.rvm/rubies/ruby-1.9.3-p194/bin/irb" 
    gem:   "/home/nikhil/.rvm/rubies/ruby-1.9.3-p194/bin/gem" 
    rake:   "/home/nikhil/.rvm/gems/[email protected]/bin/rake" 

    environment: 
    PATH:   "./bundler_stubs:/home/nikhil/.rvm/gems/[email protected]/bin:/home/nikhil/.rvm/gems/[email protected]/bin:/home/nikhil/.rvm/rubies/ruby-1.9.3-p194/bin:/home/nikhil/.rvm/bin:/usr/local/java/jre1.7.0/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" 
    GEM_HOME:  "/home/nikhil/.rvm/gems/[email protected]" 
    GEM_PATH:  "/home/nikhil/.rvm/gems/[email protected]:/home/nikhil/.rvm/gems/[email protected]" 
    MY_RUBY_HOME: "/home/nikhil/.rvm/rubies/ruby-1.9.3-p194" 
    IRBRC:  "/home/nikhil/.rvm/rubies/ruby-1.9.3-p194/.irbrc" 
    RUBYOPT:  "" 
    gemset:  "beasport" 
</pre> 

我錯過了一些東西。 我檢查這個問題,但對我的情況沒有幫助 RVM - Not able to use gems from the @global gemset 在此先感謝您的幫助。

回答

1

好的..我知道了......所以要將@global gemset中的寶石放入您的項目特定的gemset中,您仍然必須將它們列入您項目的gemfile中。我沒有跟隨,現在我可以使用撬

group :development do 
    gem 'pg', '0.14.1' 
    gem 'annotate', '~> 2.4.1.beta' 
    gem 'pry' 
    gem 'pry-doc' 
    gem 'pry-debugger' 
    gem 'pry-stack_explorer' 
end 
+0

正確。你可以接受你自己的答案。 –

相關問題