title: How to run rake in ruby-on-rails application in production?
body: <p>I am trying to figure out how to deploy my ruby-on-rails application in production.<br><br>
  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 <a href="http://localhost:9200" rel="noreferrer">http://localhost:9200</a>). But when the application tries to access components of elastic search i get an error.<br><br>
  There is a rake file in the directory /app/lib/tasks, which has several files and one of the them is elasticsearch.rake</p>
  
  <pre><code>namespace :app do
    desc "Bootstraping Elasticsearch index"
    task(:elasticsearch =&gt; :environment) do
  
      Image.__elasticsearch__.create_index! force:true
      Image.import
  
      CaseStudy.__elasticsearch__.create_index! force:true
      CaseStudy.import
  
    end
  end
  </code></pre>
  
  <p>As the description in the file says this bootstraps the elastic search index.<br> <b>What I don't know is how do I run all this in a production environment?</b> There are other rake files as well and I want to know how to run them.</p>