I am trying to figure out how to deploy my ruby-on-rails application in production.
The operating system is ubuntu and the application uses Postgres. I have managed to deploy the application and am able to login etc... but there are certain functionality that is not working (I am new to the application and rails).
The application uses elastic search, which I have installed and the service is running (I can access the page via http://localhost:9200). But when the application tries to access components of elastic search i get an error.
There is a rake file in the directory /app/lib/tasks, which has several files and one of the them is elasticsearch.rake
namespace :app do
desc "Bootstraping Elasticsearch index"
task(:elasticsearch => :environment) do
Image.__elasticsearch__.create_index! force:true
Image.import
CaseStudy.__elasticsearch__.create_index! force:true
CaseStudy.import
end
end
As the description in the file says this bootstraps the elastic search index.
What I don't know is how do I run all this in a production environment? There are other rake files as well and I want to know how to run them.
You should go to the root path of your project directory in production and type the following command:
RAILS_ENV=production bundle exec rake app:elasticsearch
Note:
To check the available list of rake tasks, you can type rake -T
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With