繁体   English   中英

捆绑安装后,Gems不在Local Gems中

[英]Gems not in Local Gems after bundle install

新机器。 新的rbenv安装。 新的rbenv-gemset安装。 新的ruby-2.0.0安装。 新的rails 4.0.0应用程序。

当我

$ bundle install

从rails app目录,我得到

Your bundle is complete!
It was installed into ./vendor/bundle

但是,如果我那么

$ gem list

所有安装的宝石都没有显示出来。

我跑了

$ rbenv rehash

为什么会这样?

附加信息:

$ 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

此应用程序中的默认设置是安装到vendor/bundle 你可以告诉It was installed into ./vendor/bundle在gems安装后出现的It was installed into ./vendor/bundle文本中。

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

编辑:更多的解释是,你的ruby只知道在不使用bundle exec时使用--system选项安装的gem。 您可以通过运行bundle exec gem list或(如Casper注意到的) bundle listvendor/bundle或您选择的任何路径中查看您的gem。 现在,您可以选择是在系统位置还是在应用程序目录中使用宝石。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM