我有一个小型的网络应用程序,它使用了一堆宝石。其中一些仅用于test
和development
环境。现在,当我尝试使用以下命令在生产服务器上启动独角兽时,它失败。bundler错误地试图在生产中安装“开发”和“测试”组宝石
unicorn_rails -E production -D -c config/unicorn.rb
我在日志文件中看到错误是:
Refreshing Gem list
Could not find gem 'spork (>= 0.9.0.rc2, runtime)' in any of the gem sources listed in your Gemfile.
Try running `bundle install`.
我已经粘贴下面我的Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.1'
gem 'unicorn'
gem 'mongoid', '>= 2.0.0.beta.19'
gem 'devise'
gem 'cancan'
gem 'haml', '>= 3.0.0'
gem 'bson'
gem 'bson_ext'
gem 'formtastic'
gem 'bluecloth'
group :production do
gem 'capistrano'
end
group :development do
gem 'haml-rails'
gem 'hpricot', '0.8.2'
gem 'ruby_parser', '2.0.5'
gem 'less'
gem 'rspec-rails', '>= 2.0.1'
end
group :development,:test do
gem 'spork', '>=0.9.0.rc2'
gem 'mongoid-rspec'
end
group :test do
gem 'factory_girl_rails'
gem 'autotest'
gem 'cucumber-rails'
gem 'cucumber'
gem 'capybara'
gem 'shoulda'
gem 'database_cleaner'
gem 'test_notifier'
gem 'rspec', '2.0.1'
gem 'launchy'
end
捆绑器应该检测合适的环境,而忽略其他宝石,对吧?现在,我删除了所有不在服务器上的默认组中的行,以使其正常工作,但这是一个丑陋的黑客行为。
Capistrano的生产似乎deploy.rb不正确的? – 2013-05-30 08:52:05