我对 rails/ruby/bundle 还是新手,有点困惑。
在我们的config/application.rb
文件中有这个捆绑程序段:
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
在我们的Gemfile
我们使用不同的组,例如
group :development, :test do
gem "rspec-rails", ">= 2.7.0", :group => [:development, :test]
gem 'shoulda-matchers'
gem 'watchr'
gem 'spork', '~> 1.0rc'
gem 'spectator'
gem 'debugger'
gem 'wirble'
end
但是当我运行RAILS_ENV=production bundle install
(或bundle install --deployment
)时,它仍然会从开发/测试组安装 gem...
为什么会发生这种情况,或者我怎样才能使它正常工作?