I'm really close to having a simple Rails app deployed on Amazon Opsworks - using an EC2 instance running Phusion Passenger, and an RDS instance for the database server (it runs mySQL). The app code is grabbed from my Git Repo.
Here's the issue.
The EC2 instance will serve up my static ROR home page - the public/index.html file, so I know the app is in there, and being served.
The trouble happens when I try to do an HTTP GET to fetch representations of resources from the database.
Here is the exact error code:
"Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (Mysql2::Error)"
I'm guessing it's trying to connect to a local MySQL server on my laptop through a socket, instead of trying to connect to the Amazon RDS instance (the MySQL database server) that I specified in database.yml.
Here is my database.yml:
development:
adapter: mysql2
encoding: utf8
database: *********_development
pool: 5
username: ****
password: ****
socket: /tmp/mysql.sock
host: localhost
test:
adapter: mysql2
encoding: utf8
database: ********_test
pool: 5
username: ********
password: ****
socket: /tmp/mysql.sock
host: localhost
production:
adapter: mysql2
encoding: utf8
database: *****
username: ******
password: *****
host: ***dbinstance.*********.us-west-2.rds.amazonaws.com
port: 3306
How can I get the rails app to use the production database I specify in database.yml, instead of always trying to connect to a local database?