Deploy fails during db migration (possibly not picking up :rails_env?)

21 views
Skip to first unread message

Vell

unread,
Apr 28, 2015, 6:23:51 PM4/28/15
to capis...@googlegroups.com
Versions:
  • Ruby 2.1.5
  • Capistrano 3.3.5
  • Rails 4.1.9
Platform:
  • Working on.... Mac OS X 10.10.3
  • Deploying to... Ubuntu 14.04
Logs:

Background:

I have an app that I am working on that I started with Centos/Apache/MYSQL. I am using capistrano 3.3.5 to deploy this app and I am not having any issues with deploying which includes migrating the db.

Issue:

I am now moving to Ubuntu/Nginx/MYSQL and still using capistrano 3.3.5 to deploy this app but now I am having issues migrating the db. From what I can tell, capistrano thinking that I am wanting to migrate to a db that is on the local system but there isn't one. The DB is located on an RDS instance on Amazon AWS.

I have tried to forcefully set rails_env but nothing appears to get capistrano to recognize the environment I want to deploy to.

To double check my issue I have created a brand new application which has no other code. I installed what I think is the bare minimum for getting my rails app to deploy and this issue also occurs.

I am looking for some advice on anything else that I can try to get past this issue. Any help is greatly appreciated.\

Thanks

Vell

unread,
Apr 28, 2015, 10:33:36 PM4/28/15
to capis...@googlegroups.com
As I am picking around with things, it seems that anything that I set in deploy.rb isn't recognized by any of my files in lib/capistrano/tasks. For instance, if I have the following in deploy.rb

set :running_dir, File.dirname(__FILE__)

I am not able to use fetch(:running_dir) in /lib/capistrano/tasks/nginx.rb in a method such as

  desc "create #{fetch(:application)} nginx.conf"
  task
:generate_nginx_conf do
    on roles
(:app) do
      info
"creating #{fetch(:application)} nginx.conf file"
      open
(fetch(:nginx_conf_file), 'w') do |f|
        f
.puts(ERB.new(File.read(fetch(:running_dir) + "/templates/nginx.conf.erb")).result(binding))
     
end
   
end
 
end

However, fetch(:application) is working without any issue. I can see that in the info string when capistrano runs. I don't know if this relates to my issue or how to correct it at this moment.

Lee Hambley

unread,
May 1, 2015, 10:14:15 AM5/1/15
to Capistrano
Do you perhaps have more than one deploy.rb ?

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/89bad802-92d8-448b-acc9-74c0fa6e44ab%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages