[英]RVM - Not able to use gem from global gemset
I installed 'pry' in global gemset.我在全局 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'.那是当我在我的代码中使用“binding.pry”然后它说 - 无法解析“撬”。 I tried with : require 'pry' and load 'pry.rb' but no luck.我试过:需要“撬”并加载“撬.rb”但没有运气。
<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.我检查了这个问题,但对我的案例RVM没有帮助- 无法使用来自 @global gemset 的 gems 在此先感谢您的帮助。
Ok.. I got it...so to use gems in @global gemset into your project specific gemset, you still have to put enlist them in your project's gemfile.好的..我明白了...所以要将@global gemset 中的 gems 用于项目特定的 gemset,您仍然必须将它们放入项目的 gemfile 中。 I did following and now i am able to use 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.