David
David

Reputation: 10758

RoR understanding deployment

I am VERY new to RoR(going through Michael Hartl's tutorial now). I understand there are three states(?) that your app can be in: development, production, and test. And each state typically uses different database types.

I've created a blank rails app, put it under git, and deployed it to heroku. That all works. Is my app in the production state on heroku or is it still in development? How do you check?

I think i remember reading the Gemfile specifies the resources to install in the different states. Does heroku default to use whatever is specified in the production block? or am i way off?

my Gemfile

source 'http://rubygems.org'
gem 'rails', '3.0.11'
gem 'sqlite3', '1.3.3'

Upvotes: 1

Views: 117

Answers (2)

Jakub Arnold
Jakub Arnold

Reputation: 87260

Heroku will use produciton by default. That's why you should specify production gems separate of your other gems.

For example specifically on Heroku you'll want to add the 'pg' gem because they're using Postgre database.

gem 'pg', :group => :production

But since you only need this in production, there's no need to have it in development. Same as there is no need for the sqlite gem to be in your production environment.

group :development, :test do
  gem 'sqlite3'
  gem 'rspec' # or any other testing gems, etc.
end

Upvotes: 1

John Beynon
John Beynon

Reputation: 37507

You can check by looking at the output of heroku config you're looking for the RAILS_ENV and/or RACK_ENV, it will be set to production by default.

Upvotes: 1

Related Questions