On 24 January 2012 17:19, Peter Vandenabeele <pe...@vandenabeele.com> wrote:
> On Tue, Jan 24, 2012 at 6:07 PM, David Ekdahl <li...@ruby-forum.com> wrote:
>>
>> Peter Vandenabeele wrote in post #1042328:
>> > On Tue, Jan 24, 2012 at 5:40 PM, David Ekdahl <li...@ruby-forum.com>
>> > wrote:
>> >
>> >> Hello,
>> >>
>> >> The log says:
>> >> Mysql::Error - Can't connect to MySQL server on 'remote.host.local'
>> >> (13):
>> >>
>> >> But why... When I run mysql -h remote.host.local -u user -p form the
>> >> server it works.
>> >>
>> >
>> > Could you run this on your database.yml file (from your Rails root)
>> > and check if it looks like you expect? Subtle space/tab errors may
>> > yield an invalid database.yml file.
>> >
>> >  $ irb
>> > 1.9.3p0 :001 > require 'yaml';
>> > YAML::load(File.open('config/database.yml'))
>> > => {"development"=>{"adapter"=>"postgresql", "encoding"=>"unicode",
>> > "pool"=>5, "username"=>"peterv", "password"=>nil, "min_messages"=>"log",
>> >
>> > HTH,
>> >
>> > Peter
>>
>> Hello Peter, thank's for your answer.
>>
>> Do you want me to just copy and paste the code inside my database.yml
>> file?
>>
>> What does it do?
>
>
> $ irb
> 1.9.3p0 :001 > require 'yaml'; YAML::load(File.open('config/database.yml'))
>
> And check the output yourself (no need to copy, may contain passwords etc.).
>
> It parses the database.yml file (which is obviously a YAML file). If you
> have
> formatting problems in that file, it may be visible in the result.

In case it is still not clear, Peter means you to open a terminal and
cd to the top level of your rails projectexit.  Then type
irb
and when it comes back with the prompt enter the require .... line and
see what it says.  You can then check the host, database, username and
pwd are correct for the environment (development or production).
To get back to the terminal prompt type exit

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to