Installing Command line interface
heroku command-line tool is an interface to the Heroku Platform API and includes support for things like creating/renaming apps, running one-off dynos, taking backups, and configuring add-ons. Most app management activities require the Heroku CLI to be installed and configured alongside your local working environment.
$ wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
Once installed, you’ll have access to the heroku command from your command shell. Log in using the email address and password you used when creating your Heroku account:
$ heroku login Enter your Heroku credentials. Email: firstname.lastname@example.org Password: Could not find an existing public key. Would you like to generate one? [Yn] Generating new SSH public key. Uploading ssh public key /Users/adam/.ssh/id_rsa.pub
If you have public keys already at ~/.ssh/id_rsa.pub then it will ask you if it can use the keys that are already.
You’re now ready to create your first Heroku app:
# Change the directory to your app folder # [unique-app-name] is optional # It adds a remote repository in your git type git remote $ cd ~/myapp $ heroku create [unique-app-name] Creating stark-fog-398... done, stack is cedar http://stark-fog-398.herokuapp.com/ | email@example.com:stark-fog-398.git Git remote heroku added
Uploading your app to heroku
Your need to commit every changes you want to show in your app before you push your app to heroku.
# If you have made any changes to Gemfile then you must bundle once # before you push. And dont forget to commit the changes # it makes in Gemfile.lock. $ bundle install $ git add . $ git commit -m "Bundle before deployment"
$ git push heroku [branch] # If heroku refuses to install app due to some gem is not supported # then you can tell heroku to just ignore the gems in development group
Make changes to bundle settings
If you have any gems used that is not supported in heroku such as Sqlite then you need to say heroku to ignore gems in development group
heroku config:set BUNDLE_WITHOUT="development:test"