我做出了错误的选择,现在我坚持在项目的中间 我使用了ruby 5.0.0rc1,当我用rubymine开始我的项目时,我得到了#34; ActiveRecord :: ConnectionNotEstablished"
在输入rake db:create:
时,我也收到错误消息Gregoires-MacBook-Pro:p1 gregoire$ rake db:create
Rake tasks not supported by 'pg' adapter
Couldn't create database for {"adapter"=>"pg", "pool"=>5, "timeout"=>5000, "database"=>"pg"}
rake aborted!
ActiveRecord::Tasks::DatabaseNotSupported: Rake tasks not supported by 'pg' adapter
我的数据库/ yml:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: 'pg'
pool: 5
timeout: 5000
development:
<<: *default
database: 'pg'
test:
<<: *default
database: 'pg'
production:
<<: *default
database: 'pg'
我是ror的新手,任何帮助将不胜感激(请详细说明)
格雷格
答案 0 :(得分:2)
config/database.yml
为Rails提供访问您选择的数据库所需的信息。
适配器名称pg
无效。如果您打算使用PostgreSQL,则应将其设置为postgresql
。
你必须确保PostgreSQL is installed and running。
典型的database.yml
可能如下所示:
default: &default
adapter: postgresql
encoding: unicode
pool: 5
timeout: 5000
username: your_username_for_postgresql
password: your_password_for_postgresql
development:
<<: *default
database: your_app_name_development
test:
<<: *default
database: your_app_name_test
production:
<<: *default
database: your_app_name_production
username: your_username_for_postgresql_on_production
password: your_password_for_postgresql_on_production
答案 1 :(得分:0)
感谢您的回答,我遇到了多个问题:
1 / Postgresql未正确安装并正在运行 使用此处的一些注释进行全新安装: https://gist.github.com/lxneng/741932
2 /我的数据库.yml没有正确配置,我创建了用户 新访问权限:http://www.cyberciti.biz/faq/howto-add-postgresql-user-account/
你给我的建议让我找到了方向,也是一个开箱即用的项目&#39;不可运行
感谢您的时间和建议
格雷格