On my local Mac OSX, I want to run a rake task on a server which is within the my network. All the seeds to the remote mysql database work fine. But when I try to seed the mongodb data, I get the following error:
bundle exec rake db:seed RAILS_ENV=staging
rake aborted!
Moped::Errors::ConnectionFailure: Could not connect to a primary node for replica set
#<Moped::Cluster:70258359778560 @seeds=[<Moped::Node resolved_address="10.10.4.131:27017">]>
/Users/donato/.rvm/gems/ruby-2.1.2@core/gems/moped-2.0.4/lib/moped/cluster.rb:254:in `with_primary'
I am able to deploy to that server using capistrano. So I know it is not a networking issue. I also already tried the solution here. I deleted mongod.lock and then ran service mongod restart
, without luck. However in that question, he was trying to run it on localhost, whereas I want to run it on another computer but within my network. What can I do?