Deploying Rails App to Heroku

No Comments

My first experience installing a Rails app on Heroku. A pretty easy way to deploy Rails apps.

If you made any changes to your gemfile, make sure to run
bundle install –without production
Even if you already have all of the gems installed. This updates Gemfile.lock, which will be used by Heroku.

If you are on Windows, make sure to remove “.exe” from bundle, rails, and rake inside of your bin folder:
#!/usr/bin/env ruby.exe

Create a free account on Heroku if you don’t have one yet. Download the Heroku Toolbelt.
From the command line:

heroku login
cd path_to_you_app
heroku create

This will create a new Heroku application and set up the remote Git repo. You can optionally specify a name for your app in “heroku create” command, or you can rename it later.

Now, lets push the code to Heroku and run all the DB commands if necessary:

git push heroku master
heroku run rake db:migrate
heroku run rake db:seed
heroku open

To update you app, just push to heroku master.

To get information about your Heroku apps:

heroku apps
heroku ps
heroku logs
heroku run console

The last command will launch a remote Rails console session.

To rename your app:
heroku rename new_name

To destroy your app:
heroku destroy app_name

Categories: Rails

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Loading Facebook Comments ...