在文本、开发环境中使用 ruby-debug19 在 AppCloud 上部署错误
在 EY AppCloud 中,即使您在开发环境中运行,它们也会运行捆绑器——无需开发和测试。我的 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 忽略测试、开发环境 gem。在这两种情况下它都在本地工作。谁能想到是什么可能导致这种情况?
In EY AppCloud, even when you run in development env, they run bundler --without development and test. My Gemfile contains this
group :test, :development do
gem 'ruby-debug19', :require => 'ruby-debug'
end
and when I deploy I get this error:
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
If I comment out the gem 'ruby-debug19' line in Gemfile it works. But it should be ignoring that anyway since as mentioned, AppCloud ignores test, development env gems. It works locally in both cases. Can anyone think at all what might cause this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信这是因为
config/application.rb
使用一些组名称调用Bundler.require
,其中一个是Rails.env
。您在命令行上的RAILS_ENV
是development
,这意味着Bundler.require
正在尝试加载development
组并且require 其中的内容,包括 ruby-debug。由于该捆绑包已安装在development
组中,因此它会损坏。在本地运行您的应用程序时,最好对
RAILS_ENV
使用development
,并在 AppCloud 上为您的应用程序使用staging
或生产
。I believe this is because
config/application.rb
callsBundler.require
with a few group names, one beingRails.env
. YouRAILS_ENV
on the command line isdevelopment
, which meansBundler.require
is trying to load thedevelopment
group and require things in it, includingruby-debug
. Since the bundle has been installed thedevelopment
group, it breaks.Probably best to use
development
forRAILS_ENV
when running your app locally and eitherstaging
orproduction
for your app on AppCloud.默认情况下,AppCloud 不安装“开发”或“测试”组。您需要在 eydeploy.rb 文件中进行配置。您可以在 http://docs.engineyard.com/bundler 找到有关安装组的文档-tips-for-appcloud.html。
AppCloud does not install the 'development' or 'test' groups by default. You would need to configure that in an
eydeploy.rb
file. You can find documentation about Installation Groups at http://docs.engineyard.com/bundler-tips-for-appcloud.html.