开发者

failed to connect to any given host:port - RoR Error?

开发者 https://www.devze.com 2022-12-24 16:25 出处:网络
I\'m very new to Ruby on Rails so please go easy!I\'ve uploaded the whole application to the server (Dreamhost) and gone through the steps.But when I try to run it I get the following error:

I'm very new to Ruby on Rails so please go easy! I've uploaded the whole application to the server (Dreamhost) and gone through the steps. But when I try to run it I get the following error:

failed to connect to any given host:port (Mongo::ConnectionFailure)

I have installed the Mongo gem; but maybe I haven't got it configured correctly? I know you can't use localhost for describing where a Dreamhost mysql database is; might it be something like that?

These are the first five lines of the backtrace if that helps?:

    /home/user/.gem/ruby/1.8/gems/mongo-0.19.1/lib/../lib/mongo/connection.rb   440 in `connect_to_master'
1   /home/user/.gem/ruby/1.8/gems/mongo-0.19.1/lib/../lib/mongo/connection.rb   131 in `initialize'
2   /home/user/.gem/ruby/1.8/gems/magent-0.3/lib/magent.rb  19  in `new'
3   /home/user/.gem/ruby/1.8/gems/magent-0.3/lib/magent.rb  19  in `connection'
4   /home/user/.gem/ruby/1.8/gems/magent-0.3/lib/magent.rb  27  in开发者_如何学JAVA `database='
5   /home/user/.gem/ruby/1.8/gems/magent-0.3/lib/magent.rb  35  

Any help much appreciated and apologies for my n00bishness! Thanks.


It looks like you are trying to connect to a MySQL database using Mongo (since you mentioned that Dreamhost uses MySQL), so there is something wrong with your database configuration.

I am not aware of the correct information for Dreamhost, but make sure that your config/database.yml looks like this:

production:
  adapter: mysql
  database: <insert database name>
  host: <insert database host>
  user: <insert database username>
  password: <insert database password>
0

精彩评论

暂无评论...
验证码 换一张
取 消