We just upgraded our virtual machines to what I thought was an identical ruby configuration (via RVM... Ruby 1.9.2, Rails 3.0.7, DataMapper 1.1.0). The biggest difference was that we went from MySQL 5.0 to 5.1.
For some reason, the exact same code/database.yml that was working on our old VMs now fails on our new ones at the point it tries to connect to the database.
The issue is that this YAML:
mysql_defaults: &mysql_defaults
adapter: mysql
encoding: UTF-8
username: user
password: pass
host: localhost
development:
<<: *mysql_defaults
database: devdb
production:
<<: *mysql_defaults
database: productiondb
host: master.db.site.com
Is just expanding to:
"mysql_defaults" => {
"adapter"=>"mysql",
"encoding"=>"UTF-8",
"username"=>"user",
"password"=>"pass",
"host"=>"localhost"
},
"development" => {
"adapter"=>"mysql",
"encoding"=>"UTF-8",
"username"=>"user",
"password"=>"pass",
"host"=>"localhost"
},
"production" => {
"adapter"=>"mysql",
"encoding"=>"UTF-8",
"username"=>"user",
"password"=>"pass",
"host"=>"localhost"
}
Instead of:
"mysql_defaults" => {
"adapter"=>"mysql",
"encoding"=>"UTF-8",
"username"=>"user",
"password"=>"pass",
"host"=>"localhost"
},
"development" => {
"adapter"=>"mysql",
"encoding"=>"UTF-8",
"username"=>"user",
"password"=>"pass",
"host"=>"localhost",
"database"=>"devdb"
},
"production" => {
"adapter"=>"mysql",
"encoding"=>"UTF-8",
"username"=>"user",
"password"=>"pass",
"host"=>"master.db.site.com",
"database"=>"productiondb"
}
Anyone experienced this before?
According to Gemfile.lock (I deleted it and ran bundle install again, just for sanity's sake), all the installed dependencies are the same (i.e. the Gemfile.lock does not diff between the old and the new setup). Nor does the database.yml.
See Question&Answers more detail:
os