I got some problems with deploying to staging, hopefully anyone could suggest a solution.
So I am deploying Rails 4 with Capistrano to DO droplet. I have production/staging branches on different droplets (actually I am deploying staging for the first time and can't get it working). Deployment went well, I have my app in "current" folder ready. But what I have troubles with is creating database. When I run
RAILS_ENV=production bundle exec rake db:create
I get
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"blabladb", "pool"=>5, "username"=>"root", "password"=>"pass", "host"=>"111.11.11.111"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
I go to production.log and it says something like
FATAL Mysql2 Error Can't connect to MySQL server on "111.11.11.111" (111)
I try to connect to mysql from console - everything goes fine. I do not know what the problem could be here.
My database.yml from current folder:
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: blabladb
pool: 5
username: root
password: pass
host: 111.11.11.111
host
from? – Robin Fishermysql
command-line tool? – tadman