Web App Meetup Homework 1
Create a New Rails App
- $ rails new <name_of_app>
- $ cd <name_of_app>
- $ bundle install
Install Devise
Install Postgres
http://www.postgresql.org/download/linux/ubuntu/$ gem install pg
Add gem 'pg' to your Gemfile and run bundle install.
-------------------------------
In config/database.yml, use the following settings:
(yaml is white space delimited so make sure you space it exactly like this)
development:
adapter: postgresql
encoding: unicode
database: <yourdatabasename>
pool: 5
password: <yourpassword_orleaveitblank>
test:
adapter: postgresql
encoding: unicode
database: <yourdatabasename>
pool: 5
timeout: 5000
production:
adapter: postgresql
database: <yourdatabasename>
pool: 5
timeout: 5000
user: <yourusername>
password: <yourpassword>
----------------------------------
For Ubuntu Trusty64
1. Create the file /etc/apt/sources.list.d/pgdg.list
2. add a line for the repository
deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
Import the repository signing key, and update the package lists
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get update
------------------------------------
http://stackoverflow.com/questions/20587779/heroku-wont-recognize-pg-gem-in-my-rails-app-gemfile
Once installed, make sure you initialize the pg datastore.
also, depending how your pg is installed, you might need to specify the username and host in your database.yml file
username: someuser_on_pg
host: localhost
No comments:
Post a Comment