First, install basic ruby and rubygems packages:
$ sudo apt-get install ruby ruby-dev rubygems
If your app needs to make requests over SSL, install Ruby OpenSSL bindings:
$ sudo apt-get install libopenssl-ruby
SET UP POSTGRES AND DATABASES:
Install basic postgres packages. Note that some applications won't require postgresql-contrib:
$ sudo apt-get install postgresql postgresql-8.3 postgresql-8.3-plr
postgresql-client-8.3 postgresql-client-common postgresql-common
postgresql-contrib postgresql-contrib-8.3 postgresql-server-dev-8.3
Install the postgres gem (tested w/ version 0.7.9.2008.01.28)
$ sudo gem install postgres
Initialize postgres. As your system's postgres user:
$ initdb -D /var/lib/pgsql/data
$ pg_ctl -D /var/lib/pgsql/data -l logfile start
Make sure postgres starts on boot. In Ubuntu, this should be done automatically for you, but just to be sure:
$ sudo update-rc.d postgresql-8.3 defaults
# System startup links for /etc/init.d/postgresql-8.3 already exist
As the postgres user, create a user for psql; answering no to all questions. This will probably be the user referenced in your database.yml config file.
$ createuser dbuser
In order to give the user privilages to run DROP DATABASE for commands like
rake:test, you may have to do the following in psql:
ALTER USER dbuser CREATEUSER;
No comments:
Post a Comment