rails new app_name -d postgresqlGiven that you want to use postgresql. exclude -d postgresql to setup with SQLite.
- edit yml (if applicable)
- edit gemfile --> see 'gemfile for dev/test' gist
| #put $ echo $USER cgelinas in the terminal RIGHT AFTER putting this in your database.yml file! | |
| development: &defaults | |
| adapter: postgresql | |
| encoding: unicode | |
| pool: 5 | |
| host: localhost | |
| username: <%= `echo $USER`.chomp %> | |
| password: | |
| database: <%= File.basename(Rails.root) %>_development |
| language: ruby | |
| rvm: | |
| - 2.1.0 | |
| before_script: | |
| - "sh -e /etc/init.d/xvfb start" | |
| - "export DISPLAY=:99.0" | |
| - "export JASMINE_SPEC_FORMAT=documentation" | |
| env: | |
| - PG_USERNAME='postgres' |
| ---------------------------------------------------------------------- | |
| #### Steps to create Rails App #### | |
| ---------------------------------------------------------------------- | |
| 1.) rails new app_name -d postgresql | |
| 'Jesse's way': rails g model Complaint descriptor:string address:string latitude:decimal longitude:decimal zip:integer | |
| 2.) database.yml → 'Phil's gist' | |
| - put in: echo $USER in the terminal right after to make sure it works. | |
| 3.) rake db:create | |
| 4.) Insert ‘gem’ gist for development: |
| --- HEROKU STEPS to SET UP: --- | |
| (Make sure you're all pushed/pulled on master before doing anything heroku) | |
| 1. git init | |
| 2. git add -A | |
| 3. git commit -m “blah, blah” | |
| 4. heroku create | |
| 5. To add heroku ENV keys/variables → (If there are any). |
| 1. Go to herokuapp dashboard | |
| 2. Go to your app --> then 'settings' | |
| 3. Click on 'Get add ons' --> Then find 'New Relic' and click to read the docs | |
| 4. Then from within your app in the terminal type: heroku addons:add newrelic:stark | |
| 5. Go back to your app on heroku and click on the "New Relic" icon. | |
| 6. Then in the page that opens up click on 'I agree' | |
| 7. Add this gem to your gemfile --> gem 'newrelic_rpm' in production - like so: | |
| group :production do | |
| gem 'newrelic_rpm' |