Problems after moving server

We’re moving our sites to a new dedicated server and have access to test
before switching over. We’ve got everything working except a Ruby app
that we have.
I’m a complete Ruby novice and this app was written by someone that
we’re now struggling to get hold of.
The app is working fine on the existing server but not on the new
server. Support on new server have been trying hard to locate the
problem but not succeeded so far. I’m hoping maybe someone here would be
able to throw some light on it.

Existing server is Linux with PHP 5.2.17 and MySQL 5.0.96

New server is Linux with PHP 5.5.32 and MySQL 5.6.29

I don’t know how to find out which version of Ruby is on each but I do
know that both are using rubygems mysql

We’ve checked that everything in database.yml is correct

development:
adapter: mysql
encoding: utf8
reconnect: false
database: ******
pool: 5
username: ******
password: ******
socket: /var/lib/mysql/mysql.sock

Warning: The database defined as “test” will be erased and

re-generated from your development database when you run “rake”.

Do not set this db to the same as development or production.

test:
adapter: mysql
encoding: utf8
reconnect: false
database: ******
pool: 5
username: ******
password: ******
socket: /var/lib/mysql/mysql.sock

production:
adapter: mysql
encoding: utf8
reconnect: false
database: ******
pool: 5
username: ******
password: ******
socket: /var/lib/mysql/mysql.sock

The only clue we’ve had to what the problem might be is when hosting
company have manually run the cron and got the following

/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:inretrieve_connection’
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in
connection' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.18/lib/active_record/transactions.rb:182:intransaction’
from /usr/lib/ruby/gems/1.8/gems/bj-1.0.1/lib/bj/table.rb:240:in get' from /usr/lib/ruby/gems/1.8/gems/bj-1.0.1/lib/bj/table.rb:236:in[]’
from /usr/lib/ruby/gems/1.8/gems/bj-1.0.1/lib/bj/runner.rb:61:in
tickle' from /usr/lib/ruby/gems/1.8/gems/bj-1.0.1/lib/bj/api.rb:66:insubmit’
from call_run_enquiries.rb:4

As far as I can tell the “ActiveRecord::ConnectionNotEstablished” is
indicating a problem with connecting to the database??
Any help tracking down the problem will be greatly appreciated.

Assuming that the database migration was done correctly, my guess would
be that the error either is related to some difference between the MySql
versions, or due to some access permission problem, or the way the DB
host is accessed (hostname for instance).

Without digging into your application, it is hard to track down the
error. I would proceed as follows:

  • Find in the code the place, where the connection parameters are
    actually passed to the database. Also have the port number printed out.

  • Then, write a small program which just connects to the database, and
    see whether this works.

I admit that this is difficult without deeper experience with Ruby, but
I don’t see a simpler solution, except of wild guessing.