如何使用rails项目配置Postgresql?

时间:2013-04-23 14:59:06

标签: ruby-on-rails ruby postgresql database-connection

我对红宝石很新。我正在尝试运行BBYIDX并跟随How to install BBYIDX on Windows?

当我尝试rake db:migrate时,它会将错误重现为

(in /home/virinchy/BBYIDX-2/BBYIDX-master)  
DEPRECATION WARNING: Rake tasks in vendor/plugins/acts_as_tsearch/tasks,   vendor/plugins/acts_as_tsearch/tasks, vendor/plugins/delayed_job/tasks,   vendor/plugins/nested_scenarios/tasks, vendor/plugins/rails-authorization-plugin/tasks, and   vendor/plugins/rails_rcov/tasks are deprecated. Use lib/tasks instead. (called from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.11/lib/tasks/rails.rb:10)  
rake aborted!  
FATAL:  password authentication failed for user "bbyidx"  
FATAL:  password authentication failed for user "bbyidx"
Bundle install was succesful with message as:Your bundle is complete!  
Use `bundle show [gemname]` to see where a bundled gem is installed. 

rake db:migrate会产生此错误。我正在投放ubuntu 12.04ruby-1.8.7rails-2.3.11gem 1.5.3

我该如何解决这个问题? 提前谢谢。

1 个答案:

答案 0 :(得分:4)

您是否为postgres用户设置了密码?

config/database.yml中,您应该正确设置数据库:

development:
  adapter: postgresql
  encoding: unicode
  database: your_app_development # name your development app something
  host: localhost
  pool: 5
  username: your_username
  password: your_password # or leave blank if you didn't set a password

test:
  adapter: postgresql
  encoding: unicode
  database: your_app_test
  host: localhost
  pool: 5
  username: your_username
  password: your_password