我有一些宝石,包括ruby-debug在一个名为:development的捆绑组中 . 当我运行bundle命令时,这些gem被忽略,它只安装不在任何组中的gem . 如何确保bundler不会忽略:development组中的gem?
编辑:这是我的Gemfile的样子 .
source 'http://rubygems.org'
gem 'rails', '3.0.1'
# Auth gems
gem "devise", "1.1.3"
gem "omniauth"
# Bundle Mongoid gems
gem "mongoid", "2.0.0.beta.19"
gem "bson_ext"
# Asset gems
gem 'jquery-rails'
gem "jammit"
# Controller gems
gem 'inherited_resources', '1.1.2'
# View gems
gem 'haml'
gem 'formtastic', '~> 1.1.0'
# Nokogiri
gem "mechanize"
gem "json"
group :development do
gem "ruby-debug"
gem 'compass'
gem 'compass-colors'
gem 'pickler'
gem 'haml-rails'
gem 'rails3-generators'
gem "hpricot"
gem "ruby_parser"
gem 'fog'
end
6 Answers
我遇到了一个类似的问题 - 暂存时没有被忽略 - 并且解决方案是在进入'全局'空间时将其推出:
More
事实上,Rails在开发环境中自动加载
:development
组 . 检查你应用程序中的Rails.env
是否真的返回"development"
.有关Bundler中组的更多信息:http://gembundler.com/groups.html
在一个学期内,它会记住
without
选项 . 如果你第一次跑它记得你这样做了,并会自动重复这个
运行其他东西,比如
bundle install --without nothing
应该清除缓存 . 我对吗?update 20150214: 根据@Stan Bondi(https://github.com/bundler/bundler/issues/2862)评论中引用的问题,这已在bundler 2.0中修复 . 谢谢斯坦 .
如果您正在使用rails,则会在rails根目录中将一个文件
config
写入名为.bundle
的隐藏目录:在我的例子中,这个文件完全符合
without
设置 .所以我刚刚删除了
.bundle
目录:之后:
bundle install
按预期再次工作 .我有同样的问题和
--with
旗为我工作 . 您需要传递要包含的组名称 . 像那样: