Ruby on rails 未找到Capistrano部署、资产管道、ruby调试
我正在将我的Rails 3.2.2、Ruby 1.9.3应用程序和Capistrano部署到Linux服务器上。当我运行Ruby on rails 未找到Capistrano部署、资产管道、ruby调试,ruby-on-rails,ruby-on-rails-3,deployment,capistrano,asset-pipeline,Ruby On Rails,Ruby On Rails 3,Deployment,Capistrano,Asset Pipeline,我正在将我的Rails 3.2.2、Ruby 1.9.3应用程序和Capistrano部署到Linux服务器上。当我运行cap deploy时,出现以下错误: * executing `deploy:assets:precompile' * executing "cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=asset
cap deploy
时,出现以下错误:
* executing `deploy:assets:precompile'
* executing "cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
servers: ["example.com"]
[example.com] executing command
[example.com] sh -c 'cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'
** [out :: example.com] rake aborted!
** [out :: example.com] cannot load such file -- ruby-debug
** [out :: example.com]
** [out :: example.com] (See full trace by running task with --trace)
command finished in 8962ms
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/production/releases/20120418090209; true"
servers: ["example.com"]
[example.com] executing command
[example.com] sh -c 'rm -rf /var/www/production/releases/20120418090209; true'
command finished in 176ms
failed: "sh -c 'cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on example.com
它说,ruby调试
gem没有找到。但是ruby debug不在my Gemfile的生产组中:
group :development, :test do
gem "steak"
gem "linecache19", :git => "git://github.com/mark-moseley/linecache", :require => "ruby-debug"
gem "ruby-debug-base19x", "~> 0.11.30.pre4"
gem "ruby-debug19"
gem "rails_best_practices"
gem "ruby_parser"
gem "reek"
gem "flog"
gem "jslint_on_rails", :git => "git://github.com/psionides/jslint_on_rails"
gem "jasmine-rails"
end
由于在执行rake-assets:precompile
命令后抛出错误,我认为它与Capistrano和Capfile中的load'deploy/assets'
调用有关:
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['config/deploy/recipes/*.rb','vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
当我删除这一行时,一切都部署得很好,但是(当然)在生产中找不到这些资产。而且,如果我直接在服务器上(在app目录中)运行bundle exec rake RAILS\u ENV=production RAILS\u GROUPS=assets:precompile,我会得到相同的错误
那我该怎么办呢?ruby debug已经过时了。在ruby>=1.9中,您应该使用优秀的
debugger
gem
见:和