Ask A Question


You’re not receiving notifications from this thread.

An other deployment question

Romain Nim asked in Servers

Hello everyone!

I'm new to Rails (and at coding in general) and english is not my mother tongue, so I might say clumsy stuffs, so please bear with me :D

I'm finally ready to launch my first app live! And I find the transition from heroku to DigitalOcean brutal... I've been trying to deploy my app for days now without success. The tuto on GoRails got me really excited since it carried me further than any other one and it feels like the app is really close to be launch. However, even though I kind of understand each steps, when my terminal is throwing errors at me, I feel pretty overwhelmed and don't really understand what's going on. So if someone can give me some guidance, that would be really appreciated!

So, I arrived at the cap production deploy step and created the database.yml. I skipped all the secrets.yml steps since it wasn't mandatory.

From my poor understanding, there are a lot of dependencies issues? I tried a bundle install/update to solve that but it seems like it was a useless attempt. Also they asked me to put a "Devise.secret_key", so I put one in the "initializers/devise.rb" and that's confusing me a little since the key seems to change eveytime that I run "cap production deploy"
So that's the errors I'm running into:

Tasks: TOP => deploy:assets:precompile
The deploy has failed with an error: Exception while executing as deploy@ rake exit status: 1
rake stdout: Nothing written
rake stderr: DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /home/deploy/portfolio/releases/20160412193212/config/environments/production.rb:79)
[Simple Form] Simple Form is not configured in the application and will use the default values. Use `rails generate simple_form:install` to generate the Simple Form configuration.
rake aborted!
Devise.secret_key was not set. Please add the following to your Devise initializer:

  config.secret_key = '4d1f11683b99a6342d600aec57de1bff528436fbdaf7982c94d292e80ddfc4040b74204b75cfe854448cf814cd95c343f40094b9ccf61aaa3f3fbaf93a23f65b'

Please ensure you restarted your application after installing Devise or setting the key.
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/devise-3.5.6/lib/devise/rails/routes.rb:489:in `raise_no_secret_key'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/devise-3.5.6/lib/devise/rails/routes.rb:223:in `devise_for'
/home/deploy/portfolio/releases/20160412193212/config/routes.rb:2:in `block in <top (required)>'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/actionpack- `instance_exec'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/actionpack- `eval_block'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/actionpack- `draw'
/home/deploy/portfolio/releases/20160412193212/config/routes.rb:1:in `<top (required)>'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `load'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `block in load'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `load_dependency'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `load'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `block in load_paths'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `each'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `load_paths'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `reload!'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `block in updater'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `call'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `execute'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `updater'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `execute_if_updated'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `block in <module:Finisher>'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `instance_exec'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `run'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `block in run_initializers'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `run_initializers'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `initialize!'
/home/deploy/portfolio/releases/20160412193212/config/environment.rb:5:in `<top (required)>'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `require'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `block in require'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `load_dependency'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/activesupport- `require'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `require_environment!'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/railties- `block in run_tasks_blocks'
/home/deploy/portfolio/shared/bundle/ruby/2.2.0/gems/sprockets-rails-3.0.4/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
** Invoke deploy:failed (first_time)
** Execute deploy:failed

Came across the same issue last night but i was deploying using dokku. I had previously deployed on another app following what Chris had wrote about and it worked well.

I suspect that the issue is with me not tracking my secrets.yml file with git. I'll try it again with the secrets file tracked as well as reverting to env variables. Will let you know if it works then.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 84,256+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.