Reputation: 1
I have a situation I have been beating my head against the wall over. First, I am not a Ruby/Rails person but I am a developer. I know only the most basic information about it but I have to get this code going on this server.
It is a Windows 2008 64-Bit server with Rails & Ruby 1.9.3. Rails seems to function normally with imports and the documentation server works, etc. However, when I attempt to run the site code in its "server" I get the ConnectionNotEstablished
error.
I have also installed the MySQL connector and installed the MySQL binding although I thought it was built in. Doesn't seem to work either way.
I need either a fix or more information on how I can get more information than ActiveRecord::ConnectionNotEstablished
. If I can get to more trace info I can troubleshoot if further but I just don't know what to try next because I don't have enough information so I am stuck trying random things.
Now, here is what I have got:
Rails install folder: c:\RailsInstaller with a C:\RailsInstaller\Ruby1.9.3 folder where Ruby is.
DEFAULT SITE WORKS - Site folder: c:\sites\quote_machine and when I run c:\sites\quote_machine\rail s
in this folder the server loads without error and the "Welcome Aboard" screen comes up.
development:
adapter: mysql
database: fb
host: localhost
port: 3306
username: ******
password: ********
timeout: 5000
(also there is a test & production section)
Here is the syntax of one of the table db models:
class IncidentGroup < ActiveRecord::Base
set_table_name "incident_group"
set_primary_key "group_id"
belongs_to :prospect, :class_name => "Prospect", :foreign_key => "prospect_id"
has_many :incidents, :class_name => "Incident", :foreign_key => "group_id"
end
class Incident < ActiveRecord::Base
set_table_name "incident"
set_primary_key "incident_id"
belongs_to :incident_group, :class_name => "IncidentGroup", :foreign_key => "group_id"
end
Upvotes: 0
Views: 150
Reputation: 579
Try changing the database.yml file first. change the adapter value to "mysql2" and in your gem file make sure you are using "mysql2" gem instead of "mysql".
Upvotes: 1