I carefully studied this useful tutorial:
http://blog.willj.net/2011/05/31/setting-up-postgresql-for-ruby-on-rails-development-on-os-x/
I would really like to start rails new myappand configure postgres db automatically. Is there a way I can do it using a Rails application template or something similar?
rails new myapp
On a unix based system:
sudo -u postgres createuser -d -R -P APPNAME sudo -u postgres createdb -O APPNAME APPNAME
You can create a script and put it somewhere in your $ PATH if you cannot remember.
, rails.
, , username database.yml
username
database.yml
development: adapter: postgresql encoding: unicode database: newapp_development pool: 5 username: #your username password: ...
:
rake db:create:all