Wednesday, May 6, 2009

Rails (2.3.2) Install, MySql issues

I recently set up Rails 2.3.2 on my Windows Vista Laptop.
I just installed Ruby and Rails (2.3.2) on my Windows Vista Laptop.
I came across a problem in getting MySql working with Rails...

I used the following tutorial to perform the install:
At Step 3, if you click on "About your application’s environment", you may get the message "We're sorry, but something went wrong". If you do, continue with the steps below. If not, you are probably okay.

When you click on "About your application’s environment" here is what you should see:

Ruby version 1.8.6 (i386-mswin32)
RubyGems version 1.3.1
Rack version 1.0 bundled
Rails version 2.3.2
Active Record version 2.3.2
Action Pack version 2.3.2
Active Resource version 2.3.2
Action Mailer version 2.3.2
Active Support version 2.3.2
Application root C:/Ruby/firstproject
Environment development
Database adapter mysql
Database schema version 0


If you get the message "We're sorry, but something went wrong", here's what you need to do...

Dowload and install the following file into \Ruby\bin:

Create the "firstproject" database and the "rails" user using MySql tools. Then...

Edit the file in /Ruby/firstproject/config/database.yml:

development:
adapter: mysql
database: firstproject
username: rails
password: yourpassword
host: localhost
port: 3306
pool: 5
timeout: 5000

test:
adapter: mysql
database: firstproject
username: rails
password: yourpassword
host: localhost
port: 3306
pool: 5
timeout: 5000

production:
adapter: mysql
database: firstproject
username: rails
password: yourpassword
host: localhost
port: 3306
pool: 5
timeout: 5000

Restart rails, and you should get the appropriate response when you click on "About your application’s environment".

-Best...

References:


Keywords:
  • Problems with mysql
  • gem mysql install fails
  • webrick "can't convert fixnum into string"