I've added the searchkick gem to my GEMFILE and I also installed ElasticSearch 1.0 with Autoparts. I'm still getting a connection refused message though when I attempt to reindex one of my models. I'm thinking it is possibly because my elasticsearch server hasn't been started. I'm unsure how to start it though on Nitrous.io. Below is the command I'm attempting to run and the error message I'm receiving...
Command
rake searchkick:reindex CLASS=Player
Result
rake aborted!
Faraday::ConnectionFailed: Connection refused - connect(2) for "localhost" port 9200
...
So as silly as this is... I just thought to try and type elasticsearch in my Console of Nitrous.io and that command started my elasticsearch server and then I was able to proceed. Thanks to anyone that had looked into the issue with me!
Related
I am trying to use PostgreSql with a rails project on my local machine. But everytime I try to run rails db:migrate -- I get the following error.
I am pretty sure this has nothing to do with rails but something to do with PostgreSQL. Any idea on how to fix it?
I've always been confused on how you can executive rake db actions from the terminal. Does it go through rails and then change the db? Or does it go through some environment variable you have on your computer to find the db and then changes it?
I'm asking this because I want to run bundle exec rake db:drop but I keep getting
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
even though my bundle exec rails s connects me to a server correctly.
You can run the rake db commands with the rails server running
The error says there is no connection happening with the database and solution for this is either restart the db server
(if its postgres)
sudo service postgres restart
or may be you are providing wrong user name and password in database.yml file(this should match with the db user name and password)
I am using Windows for my development.
Here is the error I get while starting up the sidekiq server for this Rails application using Postgres RDS on AWS:
PG::ConnectionBad: timeout expired
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sequel-4.36.0/lib/sequel/adapters/postgres.rb:243:in 'initialize'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sequel-4.36.0/lib/sequel/adapters/postgres.rb:243:in 'new'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sequel-4.36.0/lib/sequel/adapters/postgres.rb:243:in 'connect'
I checked the Postgres server logs on AWS and it says:
[12826]:LOG: could not accept SSL connection: Connection reset by peer"
My gemfile is using Sequel and sequel_pg. I'm not sure if they are causing the error.
Same Postgres database connections work fine on another Rails application without Sidekiq.
I'm not sure if sidekiq is preloading the app and then forking, but if so, you want to make sure you disconnect the Sequel database connections before forking.
When I run the command: rake db:migrate RAILS_ENV=production I get the following error:
rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "93.188.167.2" and accepting
TCP/IP connections on port 5432?
So I guess my server is not listening on port 5432. So how do I solve this?
I know I have to edit some file so in addition to the instructions on how to actually edit the file (I guess it is the file named postgresql.conf?) please also tell me where I should find it.
My web application is on this directory at the server: /home/admin/www/webstudio
EDIT: I have already tried my best to follow the instructions given here: http://alexbachuk.com/launch-rails-4-application-with-passenger-and-nginx/
I am developing a spree application ,I recently removed and reinstalled ruby 1.9.3, now whenever I try rails s on terminal I get the following error :
/home/swapnil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
Try this one : rake sunspot:solr:start
Look at this issue.I guess it may be helpful to you.
sunspot_rails gem - " Errno:: ECONNREFUSED (Connection refused - connect (2)) "
You just need configure your Database connection in your database.yml and launch your SQL server with this configuration