Skip to content

Commit

Permalink
Updated Heroku deployment guide
Browse files Browse the repository at this point in the history
fixes #sinatra/sinatra-book/sinatra#62
  • Loading branch information
kathgironpe committed Nov 18, 2013
1 parent 66ddedc commit 40cb7c4
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions book/Deployment.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,43 @@ pushing to a remote git repository.
Steps to deploy to Heroku:

* Create an [account](http://heroku.com/signup) if you don't have one
* `gem install heroku`
* Download and install [Heroku toolbelt](https://toolbelt.heroku.com/)
* Make sure you have a `Gemfile`. Otherwise, you can create one and install the `sinatra` gem using `bundler`.
* Make a config.ru in the root-directory
* Create the app on heroku
* Push to it

1. Here is an example config.ru file that does two things. First, it requires
1. Install `bundler` if you haven't yet (`gem install bundler`). Create a `Gemfile` using `bundle init`. Modify your `Gemfile` to look like:

```ruby
source 'http://rubygems.org'

gem 'sinatra'
```

Run `bundle` to install the gem.

It is possible to specify a specific Ruby version on your Gemfile.
For more information, check [this](https://devcenter.heroku.com/articles/ruby-versions).

2. Here is an example config.ru file that does two things. First, it requires
your main app file, whatever it's called. In the example, it will look for
`myapp.rb`. Second, run your application. If you're subclassing, use the
`myapp.rb`. Second, run your application. If you're subclassing, use the
subclass's name, otherwise use Sinatra::Application.
```ruby
require "myapp"

run Sinatra::Application
```
```ruby
require "myapp"
2. Create the app and push to it
run Sinatra::Application
```
From the root-directory of the application
3. Create the app and push to it
```
$ heroku create <app-name> # This will add heroku as a remote
$ git push heroku master
```
From the root directory of the application, run these commands:
For more details see [this](http://github.com/sinatra/heroku-sinatra-app)
$ heroku create <app-name> # This will add heroku as a remote
$ git push heroku master

This comment has been minimized.

Copy link
@kgrz

kgrz Nov 19, 2013

I think a space is missing here. Other than that, everything is okay.

This comment has been minimized.

Copy link
@kgrz

kgrz Nov 19, 2013

Let me know if you want me to change these. I'll merge the commits and modify later. Thanks for working on this :)

This comment has been minimized.

Copy link
@kathgironpe

kathgironpe Nov 19, 2013

Author Owner

@kgrz I have made the updates. But you can make further changes as you wish.

[Heroku]: http://www.heroku.com
For more details see [this](http://github.com/sinatra/heroku-sinatra-app).
[Heroku]: http://www.heroku.com

0 comments on commit 40cb7c4

Please sign in to comment.