Search code examples
ruby-on-railsrubydeploymentcapistranoruby-on-rails-6

Cap production deploy - Rails 6 - Failing


Trying to deploy a rails 6 application to a Digital Ocean droplet.

I run cap production deploy and it fails with this error:

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Command::Failed: rake exit status: 256
rake stdout: Nothing written
rake stderr: rake aborted!
NoMethodError: undefined method `each' for #<String:0x0000565323a30eb8>
/var/www/html/Dev/rails/AppName/config/application.rb:10:in `<module:AppName>'
/var/www/html/Dev/rails/AppName/config/application.rb:9:in `<top (required)>'
/var/www/html/Dev/rails/AppName/Rakefile:4:in `require_relative'
/var/www/html/Dev/rails/AppName/Rakefile:4:in `<top (required)>'
/home/rdevc/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
/home/rdevc/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

Tasks: TOP => deploy:assets:prepare
(See full trace by running task with --trace)
The deploy has failed with an error: rake exit status: 256
rake stdout: Nothing written
rake stderr: rake aborted!
NoMethodError: undefined method `each' for #<String:0x0000565323a30eb8>
/var/www/html/Dev/rails/AppName/config/application.rb:10:in `<module:AppName>'
/var/www/html/Dev/rails/AppName/config/application.rb:9:in `<top (required)>'
/var/www/html/Dev/rails/AppName/Rakefile:4:in `require_relative'
/var/www/html/Dev/rails/AppName/Rakefile:4:in `<top (required)>'
/home/rdevc/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
/home/rdevc/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

Any idea what causes this? The gem dependencies are all satisfied and the server is running the same versions of ruby, rails and ubuntu as I have on my dev box.


Solution

  • I had endless problems deploying this app. Credentials problems, sassc nightmares and more. In the end, I started a new 5.2.2 project, copied in the controllers, models, migrations, views, routes, etc., and changed a few instances of [6.0] to [5.2]. First try deployed perfectly and the app is now live. I can only assume there is something not fully working with my rails 6 install. Thanks for your replies, guys.