Deploy to Heroku

You have a rails application, and finished your application want to deploy with Heroku, HOW ?

You should open your rails application, and in your application find Gemfile. Open Gemfile write this command

1
gem 'heroku'

in your terminal

1
bundle install

Come again to Gemfile, instead of

1
gem 'sqlite3'

write

1
2
3
4
5
6
group :development, :test do
    gem 'sqlite3'
end
group :production do
    gem 'pg'
end

in terminal

1
bundle install

Then go to Heroku, you should create a free account on heroku. When you create account you can see download toolbet button, you can run this in your computer. Open your terminal and write

1
heroku login

When you write this command, heroku want to your heroku account information, entered this

1
2
3
4
5
6
7
~  heroku login
Enter your Heroku credentials.
Email: leylakapi@gmail.com
Password (typing will be hidden):
Found existing public key: /Users/leylakapi/.ssh/id_rsa.pub
Uploading SSH public key /Users/leylakapi/.ssh/id_rsa.pub... done
Authentication successful.

After login, you should run with order

1
2
3
git add .
git commit -m "Your commit write here"
heroku create

When you heroku create you should see like

1
2
3
Creating pacific-beyond-5670... done, stack is cedar
http://pacific-beyond-5670.herokuapp.com/ | git@heroku.com:pacific-beyond-5670.git
Git remote heroku added

then

1
git push heroku master

If you want to see in our browser you should use

1
heroku open

That’s all.

I hope helped to you.

Comments