Ruby on rails 3 无法使用rake创建开发数据库
更新:正在运行Ruby on rails 3 无法使用rake创建开发数据库,ruby-on-rails-3,rake,Ruby On Rails 3,Rake,更新:正在运行 RAILS_ENV=development rake db:create 。。。作品但是,没有RAILS\u ENV前缀的rake命令不会。有什么好处 由于某些原因,我再也不能与我的开发数据库交互了 我尝试了rakedb:create,它使我的测试数据库很好,但根本没有创建dev数据库 我正在使用,直到最近,它工作得非常完美。最近没有对我的config/database.yml文件进行任何更改,也没有对我的任何应用程序配置文件进行任何更改 我可以使用psql-h localh
RAILS_ENV=development rake db:create
。。。作品但是,没有RAILS\u ENV
前缀的rake命令不会。有什么好处
由于某些原因,我再也不能与我的开发数据库交互了 我尝试了
rakedb:create
,它使我的测试数据库很好,但根本没有创建dev数据库
我正在使用,直到最近,它工作得非常完美。最近没有对我的config/database.yml
文件进行任何更改,也没有对我的任何应用程序配置文件进行任何更改
我可以使用psql-h localhost redtail_test
很好地连接到我的测试数据库,并且它使用与我的dev box相同的连接凭据,因此我可以合理地确定这不是PG的连接问题,除非它是一个奇怪的问题
redtail git:master ❯ rake db:create
redtail_test already exists
redtail git:master ❯ psql -h localhost redtail
psql: FATAL: database "redtail" does not exist
有人遇到过这个问题吗
common:&common
编码:utf8
博士后:&博士后
适配器:postgresql
用户:postgres
密码:
min_消息:警告
开发:&开发
如果您使用的是Rails 3.2.7,则出现了一个导致rake和development env出现问题的回归。它已在3.2.8中修复,目前处于第二个候选版本中,应该很快发布。顺便说一句,3.2.8版也有同样的问题。。。
common: &common
encoding: utf8
postgres: &postgres
adapter: postgresql
user: postgres
password:
min_messages: WARNING
development: &development
<<: *common
<<: *postgres
host: localhost
database: redtail
memory: &memory
<<: *common
adapter: sqlite3
host: localhost
database: ":memory:"
test: &test
<<: *common
<<: *postgres
host: localhost
database: redtail_test
production:
adapter: postgresql
encoding: utf8
database: redtail
cucumber:
<<: *test