[英]Gems not in Local Gems after bundle install
New machine. 新机器。 New rbenv install.
新的rbenv安装。 New rbenv-gemset install.
新的rbenv-gemset安装。 New ruby-2.0.0 install.
新的ruby-2.0.0安装。 New rails 4.0.0 app.
新的rails 4.0.0应用程序。
When I 当我
$ bundle install
from the rails app directory, I get 从rails app目录,我得到
Your bundle is complete!
It was installed into ./vendor/bundle
But, if I then 但是,如果我那么
$ gem list
none of the gems that were supposedly installed show up. 所有安装的宝石都没有显示出来。
I have run 我跑了
$ rbenv rehash
Why could this be? 为什么会这样?
Additional info: 附加信息:
$ which bundle
/usr/local/var/rbenv/shims/bundle
$ rbenv which bundle
/usr/local/var/rbenv/versions/2.0.0-p247/bin/bundle
$ rbenv which ruby
/usr/local/var/rbenv/versions/2.0.0-p247/bin/ruby
$ ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
$ rbenv gemset active
blog
$ which rails
/usr/local/var/rbenv/shims/rails
Your default in this app is to install to vendor/bundle
. 此应用程序中的默认设置是安装到
vendor/bundle
。 You can tell this by It was installed into ./vendor/bundle
text which appears after gems installation. 你可以告诉
It was installed into ./vendor/bundle
在gems安装后出现的It was installed into ./vendor/bundle
文本中。
Bundler documentation specifies that you have to pass --system
to install in system location: Bundler文档指定您必须将
--system
传递给系统位置中的安装:
--system: Install to the system location ($BUNDLE_PATH or $GEM_HOME) even
if the bundle was previously installed somewhere else for this
application
EDIT: More explanation is that your ruby knows only about gems installed with --system option when not using bundle exec
. 编辑:更多的解释是,你的ruby只知道在不使用
bundle exec
时使用--system选项安装的gem。 You can see your gems from vendor/bundle
or whatever path you've chosen by running bundle exec gem list
or (as Casper noticed) bundle list
. 您可以通过运行
bundle exec gem list
或(如Casper注意到的) bundle list
从vendor/bundle
或您选择的任何路径中查看您的gem。 Now it is your choice whether you want your gems in system location or in application directory. 现在,您可以选择是在系统位置还是在应用程序目录中使用宝石。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.