Ruby on rails Ruby on Rails错误:连接无效;适配器“;
我在Windows上使用Ruby on Rails(Rails版本2.3.4)和pg gem(版本0.12.2)。 My database.yml文件包含以下内容:Ruby on rails Ruby on Rails错误:连接无效;适配器“;,ruby-on-rails,ruby,Ruby On Rails,Ruby,我在Windows上使用Ruby on Rails(Rails版本2.3.4)和pg gem(版本0.12.2)。 My database.yml文件包含以下内容: production: adapter: postgresql encoding: utf8 host: localhost database: canvas4 username: canvas password: canvas port: 5433 timeout: 5000 pool: 5
production:
adapter: postgresql
encoding: utf8
host: localhost
database: canvas4
username: canvas
password: canvas
port: 5433
timeout: 5000
pool: 5
queue:
adapter: postgresql
encoding: utf8
database: canvas4_queue
host: localhost
port: 5433
username: canvas
password: canvas
timeout: 5000
pool: 5
但当我运行命令:bundle exec rake db:initial\u setup RAILS\u ENV=production
时,会出现以下错误:
无效的连接“适配器”
我也尝试过使用gem“activerecord postgresql适配器”
,但出现与上面相同的错误
我可以成功安装sqlite3驱动程序
您知道如何让postgresql适配器与rails 2.3配合使用吗 确保database.yml中的db适配器设置为“postgresql”。如果仍然存在相同的问题,请尝试使用纯ruby适配器: gem安装postgres pr (请确保在…之前卸载pg gem以避免冲突) 如果它起作用,那就是postgres gem的问题。无论如何,出于开发目的,使用纯RubyGem通常是可以的