This README would normally document whatever steps are necessary to get the application up and running.
Things you may want to cover:
-
Ruby version
-
System dependencies
-
Configuration
-
Database creation
-
Database initialization
-
How to run the test suite
-
Services (job queues, cache servers, search engines, etc.)
-
Deployment instructions
-
...
Running_app_in_production_locally
- Add
gem 'rails_12factor'
to your Gemfile. This will add error logging and the ability for your app to serve static assets. bundle
- Run
RAILS_ENV=production rake db:create db:migrate db:seed
- Run
rake secret
and copy the output - From the command line:
export SECRET_KEY_BASE=output-of-rake-secret
- To precompile your assets, run
rake assets:precompile
. This will create a folderpublic/assets
that contains all of your assets. - Run
RAILS_ENV=production rails s
and you should see your app.
Remember to clobber your assets (rake assets:clobber
) and re-precompile (rake assets:precompile
) if you make changes.
To compile assets in production mode (with css_compressor, :uglifier or other js_compressor):
rake assets:precompile RAILS_ENV=production