Connection refused - connect (2) to db rake: seed on Mongodb

I am using rails 3.2 and mongoid .

I am doing these steps to install my database:

 // Add an Admin User (to the admin db) use admin db.addUser("theadmin", "anadminpassword") // Use your database use superuser // Add a user (to your database) db.addUser("John", "passwordForJohn") // show all users: db.system.users.find() // add readonly user (kinda cool) db.addUser("readonly", "passwordForJohn", true) 

In my mongo.yml , I have:

 production: host: localhost port: 27017 username: John password: passwordForJohn database: namedatabase 

You can see at http://www.mongodb.org/display/DOCS/Security+and+Authentication

My problem is that now I am trying to run:

 rake db:seed 

Now I get this error:

 rake aborted! Connection refused - connect(2) 

How can i fix this?

+6
source share
1 answer

The problem has been fixed:

The problem was in the solr server:

If you have a solr server in your project:

1ΒΊ Verify that the Solr server is running up to seed:

 rake sunspot:solr:start rake sunspot:reindex 

2ΒΊ Launch your seed:

 rake db:seed 

Hi

+10
source

Source: https://habr.com/ru/post/918074/


All Articles