-1

I installed 'pry' in global gemset. However I am not able to use it. That is when i use "binding.pry" in my code then it says - can't resolve 'pry'. I tried with : require 'pry' and load 'pry.rb' but no luck.

<pre>
nikhil@nikhil-K54C:/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

nikhil@nikhil-K54C:/media/media1/railscode/beasport$ gem which pry
/home/nikhil/.rvm/gems/ruby-1.9.3-p194@global/gems/pry-0.9.10/lib/pry.rb
nikhil@nikhil-K54C:/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)
nikhil@nikhil-K54C:/media/media1/railscode/beasport$ rvm info

ruby-1.9.3-p194@beasport:

  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 <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [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/ruby-1.9.3-p194@beasport"
    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/ruby-1.9.3-p194@global/bin/rake"

  environment:
    PATH:         "./bundler_stubs:/home/nikhil/.rvm/gems/ruby-1.9.3-p194@beasport/bin:/home/nikhil/.rvm/gems/ruby-1.9.3-p194@global/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/ruby-1.9.3-p194@beasport"
    GEM_PATH:     "/home/nikhil/.rvm/gems/ruby-1.9.3-p194@beasport:/home/nikhil/.rvm/gems/ruby-1.9.3-p194@global"
    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>

I am missing something. I check this question but not helpful for my case RVM - Not able to use gems from the @global gemset Thanks in advance for help.

4

1 回答 1

1

好的..我明白了...所以要将@global gemset 中的gem 用于您的项目特定gemset,您仍然必须将它们登记在项目的gemfile 中。我做了以下,现在我可以使用 pry

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
于 2012-11-08T11:27:31.257 回答