Preparing Ruby on Rails environment – postgresql
Time to start some development, for next project I have decided to use (and learn) Ruby on Rails (RoR).
Many persons use mysql to develop rails apps, as it is easy to setup and use.
But postgresql has more futures then mysql, one of them is known to be used by current RoR, It is transactional DDL update, in Rails world it is called transactionall migrations.
So this is what I had to do to get it working on my gentoo box:
emerge postgresql-server –config
su – postgres -c createuser mpapis
# or you could use: sudo -u postgres createuser mpapis
In the listing i have used settings from my computer, /etc/init.d/postgresql-8.3 can be any other name starting with postgres, replace mpapis with your user name.
After running those commands You are able to run psql from yours account, from now on You can run following commands to menage Yours postgresql database:
- createdb DATABASE_NAME
- dropdb DATABASE_NAME
- createuser USER_NAME
- dropuser USER_NAME
- pg_dump DATABASE_NAME > dump.sql
- pg_dumpall > dump.sql
- psql -d DATABASE_NAME
This knowledge should be enough to continue with rails, but this comes in next days.