to establish
$ sudo apt-get install ruby-dev build-essential
or
$ sudo apt-get install postgresql-client libpq5 libpq-dev $ sudo gem install pg
Update
Below are the steps that I followed:
Install PostgreSQL and the development package
$ sudo apt-get install postgresql-9.1 $ sudo apt-get install libpq-dev
Configure a user that is the same as my Ubuntu login
$ sudo su postgres -c psql postgres=# CREATE ROLE <username> SUPERUSER LOGIN; postgres=# \q
Edit Gemfile
# Remove gem 'sqlite3' gem 'pg'
Change database.yml in the application directory
development: adapter: postgresql encoding: unicode database: appname_development pool: 5 timeout: 5000 username: <username> password: test: adapter: postgresql encoding: unicode database: appname_test pool: 5 timeout: 5000 username: <username> password:
Run batch installation
$ bundle install
Database and Migration Creation
$ rake db:create:all $ rake db:migrate
Here are the sources I used to help:
http://mrfrosti.com/2011/11/postgresql-for-ruby-on-rails-on-ubuntu/
http://railsless.blogspot.in/2012/05/howto-install-postgresql-in-ubuntu11.html
source share