Rvm和宝石,捆绑秀和宝石列表

时间:2013-07-23 12:45:24

标签: ruby-on-rails ruby gem rvm

我在轨道上使用带有ruby的RVM,当我bundle install时,它显示了比我gem list更多的宝石?与rvm有关,使用哪条路径?

捆绑安装

mds@db1:~/staging$ bundle
Using rake (0.9.6) 
Using Ascii85 (1.0.1) 
Using Platform (0.4.0) 
Using open4 (1.3.0) 
Using POpen4 (0.1.4) 
Using activesupport (2.3.17) 
Using rack (1.1.6) 
Using actionpack (2.3.17) 
Using actionmailer (2.3.17) 
Using activerecord (2.3.17) 
Using activeresource (2.3.17) 
Using acts_as_audited (1.1.1) 
Using addressable (2.2.8) 
Using builder (3.0.0) 
Using gyoku (1.0.0) 
Using nokogiri (1.5.6) 
Using akami (1.2.0) 
Using ar-extensions (0.9.5) 
Using cgi_multipart_eof_fix (2.5.0) 
Using chunky_png (1.2.5) 
Using cocaine (0.2.1) 
Using coderay (1.0.9) 
Using fssm (0.2.9) 
Using sass (3.1.18) 
Using compass (0.12.1) 
Using daemons (1.1.9) 
Using warden (0.10.7) 
Using devise (1.0.6) 
Using fastimage (1.2.13) 
Using html_compressor (0.0.3) 
Using rubyzip (0.9.8)
more gems......
Your bundle is complete!
It was installed into ./vendor/bundle

宝石列表

mds@db1:~/staging$ gem list

*** LOCAL GEMS ***

actionmailer (2.3.17)
actionpack (2.3.17)
activerecord (2.3.17)
activeresource (2.3.17)
activesupport (2.3.17)
bundler (1.3.5)
bundler-unload (1.0.1)
daemon_controller (1.1.4)
fastthread (1.0.7)
passenger (3.0.19)
rack (1.5.2, 1.1.6)
rails (2.3.17)
rake (10.1.0)
rubygems-bundler (1.2.2)
rvm (1.11.3.8)

4 个答案:

答案 0 :(得分:2)

当您使用bundle install --deploymentbundle install --path=...时会发生这种情况,它会生成.bundle/config,如下所示:

---
BUNDLE_FROZEN: '1'
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'

可以由你们其中一个同事或者捆绑者/ capistrano整合来完成:

  1. 如果是你的同事那么只需删除并忽略它:

    rm -rf .bundle
    echo '.bundle' >> .gitignore
    
  2. for capistrano rvm-capistrano描述了如何禁用它=> https://github.com/wayneeseguin/rvm-capistrano#disabling-bundle---deployment-when-using-gemsets

答案 1 :(得分:1)

在执行gem list之前确保使用应用程序的gemset:

rvm use application_ruby@application_gemset
gem list

请务必将application_ruby替换为ruby版本字符串,并将application_gemset替换为rails应用程序使用的gemset

答案 2 :(得分:1)

目录的根目录中有一个名为.bundle的隐藏目录。删除它,然后再次运行bundle。

答案 3 :(得分:0)

根据bundler documentation,在操作案例中,当前默认值可能已设置为vendor / bundle,例如事先执行bundle install --path vendor/bundle

  

进一步捆绑命令或调用Bundler.setup或Bundler.require   会记住这个位置

还要检查$ BUNDLE_PATH的内容,它显示了它的安装位置。注意:也可以通过--deployment选项将其安装到vendor / bundle。见Deplyment mode 3。

在回答here时,gem list将仅显示使用--system选项安装的gem(请参阅接受的答案和Caspar评论);改为使用bundle list来显示安装在应用程序目录中的gem,即通过bundle install(不带--system选项)。

相关问题