Railsプロジェクトのデプロイを支援するためにCapistranoを使用していますが、コマンドを実行するとcap deploy
、以下のエラーが発生します。誰が何がうまくいかないのか考えていますか?
コマンドを実行しようとしたときに生成されるエラーを次に示します。
* executing "cd -- /var/www/crowdcode/releases/20130831210643 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile"
servers: ["54.215.187.53"]
[54.215.187.53] executing command
*** [err :: 54.215.187.53] Faraday: you may want to install system_timer for reliable timeouts
*** [err :: 54.215.187.53]
*** [err :: 54.215.187.53] rake aborted!
*** [err :: 54.215.187.53] /var/www/crowdcode/releases/20130831210643/config/initializers/redis.rb:1: syntax error, unexpected ':', expecting ')'
*** [err :: 54.215.187.53] $redis = Redis.new(host: 'localhost', port: 6379, driver: :hiredis)
*** [err :: 54.215.187.53] ^
*** [err :: 54.215.187.53] /var/www/crowdcode/releases/20130831210643/config/initializers/redis.rb:1: syntax error, unexpected ',', expecting $end
*** [err :: 54.215.187.53] $redis = Redis.new(host: 'localhost', port: 6379, driver: :hiredis)
*** [err :: 54.215.187.53] ^
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/engine.rb:588
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/engine.rb:587:in `each'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/engine.rb:587
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `run_initializers'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `send'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
*** [err :: 54.215.187.53] /var/www/crowdcode/releases/20130831210643/config/environment.rb:5
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/application.rb:103:in `require_environment!'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/railties-3.2.11/lib/rails/application.rb:297:in `initialize_tasks'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/actionpack-3.2.11/lib/sprockets/assets.rake:93
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:205:in `invoke_prerequisites'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:183:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/actionpack-3.2.11/lib/sprockets/assets.rake:60
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/actionpack-3.2.11/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/actionpack-3.2.11/lib/sprockets/assets.rake:29
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:73:in `run'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
*** [err :: 54.215.187.53] /var/www/crowdcode/shared/bundle/ruby/1.8/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
*** [err :: 54.215.187.53] Tasks: TOP => environment
*** [err :: 54.215.187.53] (See full trace by running task with --trace)
command finished in 2472ms
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/crowdcode/releases/20130831210643; true"
servers: ["54.215.187.53"]
[54.215.187.53] executing command
command finished in 21ms
failed: "sh -c 'cd -- /var/www/crowdcode/releases/20130831210643 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile'"
編集:redis.rbの内容は次のとおりです
$redis = Redis.new(host: 'localhost', port: 6379, driver: :hiredis)
class << $redis
def get_json_list(key)
str = "[" << $redis.lrange(key, 0, -1).join(',') << "]"
JSON.parse(str)
end
end
編集2:
問題は、どういうわけか間違ったバージョンの Ruby を実行していたことであり、エラーから 1.8 と表示されていることがわかります。そのため、システムがデフォルトで 1.9.3 になっていることを確認する必要がありました。構文エラーはなくなり、正常に実行できました。