Ruby On Rails MYSQL

software development

#1

so I am trying to check out ruby on rails on my dreamhost account, and i cant seem to get my database configuration correct - i know the host, username and password are all correct because it works perfectly in PHP. does anyone know if there is something special that has to be done to make ruby on rails connect to mysql on dreamhost?

i also have a dedicated mysql server which when configured it works correctly, so clearly it is something related to connecting to only here at dreamhost. hoping someone has configured this and it works to help me figure out what might be the problem

support wont support 3rd party apps, so even though its a simple generic rails app (no coding by me) which wont connect to mysql when showing the app enviornment from the link on the basic ruby page.

any ideas?

thanks in advance for those that reply


#2

Can you post the contents of your database.yml file?


#3

nothing special - just standard config based on what i have read thus far

development:
adapter: mysql
database: [my db name]
username: [mysql username]
password: [mysql pass]
host: [mysql host name set up in dreamhost panel]


#4

If you’re sure all of your information is correct then there shouldn’t be any problems. There’s nothing special you need to do when using Ruby instead of another language like PHP. Did you setup your database correctly when you made the application? The default RoR application page will show even if you don’t setup your database connections, so if it’s not working then you might have another problem.

Are you getting any errors? You have a log directory in /home/username/logs/yourdomain.com/http/error.log and you’ll also have a log in your RoR application. Usually the latter has more useful information when diagnosing RoR problems.

You can paste the errors here if you like and maybe we can see what’s going on.

  • Greg
  • DreamHost Technical Support

#5

greg from support, you might be the very same person from support which told me to post here and hopefully get an answer…but in any event here are the various errors:

USING RAKE

[quote]/usr/bin/rake:17:Warning: require_gem is obsolete. Use gem instead.
[/quote]

[quote](in /home/.navajo/larrabee/testrails)
[/quote]

[quote]rake aborted!
[/quote]

[quote]Access denied for user ‘larrabeemysql’@‘shekel.dreamhost.com’ (using
[/quote]

[quote]password: YES)

[/quote]

[/quote]

and
following in my logs
Mysql::Error (Access denied for user ‘larrabeemysql’@‘shekel.dreamhost.com’ (using password: YES)):

the exact same username, password, and host name work perfectly in php.

I am not putting the @shekel.dreamhost.com part in, i am simply providing the portion in front of the “@” just like i do in php without any issue.