Ric*_*ton 5 postgresql ruby-on-rails ruby-on-rails-3 rails-postgresql
我已经按照这个非常有用的教程:
http://blog.willj.net/2011/05/31/setting-up-postgresql-for-ruby-on-rails-development-on-os-x/
我真的想跑,rails new myapp并自动设置postgres数据库.有什么方法可以使用Rails应用程序模板或类似的东西吗?
Gaz*_*ler 14
在基于unix的系统上:
sudo -u postgres createuser -d -R -P APPNAME
sudo -u postgres createdb -O APPNAME APPNAME
Run Code Online (Sandbox Code Playgroud)
如果您不记得,可以创建一个脚本并将其放在$ PATH中的某个位置.
实际上,每次创建新的rails应用程序时都不需要创建新用户.
您所要做的就是创建新的应用程序并更改username您的应用程序database.yml
development:
adapter: postgresql
encoding: unicode
database: newapp_development
pool: 5
username: #your username
password:
...
Run Code Online (Sandbox Code Playgroud)
而不仅仅是:
rake db:create:all
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8810 次 |
| 最近记录: |