在文本,开发环境中使用ruby-debug19在AppCloud上部署错误

时间:2011-08-21 18:54:29

标签: ruby-on-rails bundler engineyard

在EY AppCloud中,即使你在开发环境中运行,他们也会运行bundler - 没有开发和测试。我的Gemfile包含这个

group :test, :development do
  gem 'ruby-debug19', :require => 'ruby-debug'
end

当我部署时,我收到此错误:

Successfully installed engineyard-serverside-1.4.2
1 gem installed
~> Deploying revision a01f92c migrating to new FactoryGirl
~> Pushing code to all servers
~> Starting full deploy
~> Copying to /data/eg/releases/20110821184344
~> Ensuring proper ownership
~> Gemfile detected, bundling gems
~> Symlinking configs
ln: creating symbolic link `/data/eg/releases/20110821184344/config/database.yml': File exists
~> Migrating: cd /data/eg/releases/20110821184344 && PATH=/data/eg/releases/20110821184344/ey_bundler_binstubs:$PATH RAILS_ENV=development RACK_ENV=development MERB_ENV=development rake db:migrate --trace
rake aborted!
no such file to load -- ruby-debug
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
/data/eg/releases/20110821184344/config/application.rb:7:in `<top (required)>'
/data/eg/releases/20110821184344/Rakefile:5:in `require'
/data/eg/releases/20110821184344/Rakefile:5:in `<top (required)>'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:78:in `block in load_rakefile'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:61:in `block in run'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/data/eg/shared/bundled_gems/ruby/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/data/eg/releases/20110821184344/ey_bundler_binstubs/rake:16:in `load'
/data/eg/releases/20110821184344/ey_bundler_binstubs/rake:16:in `<main>'
~> [Attention] Maintenance page still up, consider the following before removing:
 * any deploy hooks ran, be careful if they were destructive
 * any migrations ran, be careful if they were destructive
 * your old code is still symlinked as current
Failed deployment recorded in AppCloud
Deploy failed

如果我在Gemfile中注释掉gem'ruby-debug19'行,它就可以了。但无论如何,它应该忽略,因为如上所述,AppCloud忽略了测试,开发环境。它在两种情况下都在本地工作。任何人都可以想到可能导致这种情况的原因吗?

2 个答案:

答案 0 :(得分:3)

我认为这是因为config/application.rb使用一些群组名称调用Bundler.require,其中一个群组为Rails.env。命令行中的RAILS_ENVdevelopment,这意味着Bundler.require正在尝试加载development组并要求其中的内容,包括ruby-debug。由于捆绑软件已安装在development组中,因此会中断。

在本地运行您的应用时,development可能最好使用RAILS_ENV,而在AppCloud上为您的应用运行stagingproduction可能最好。

答案 1 :(得分:0)

默认情况下,AppCloud不会安装“开发”或“测试”组。您需要在eydeploy.rb文件中配置它。您可以在http://docs.engineyard.com/bundler-tips-for-appcloud.html找到有关安装组的文档。