只在生产中出错!

时间:2011-06-16 09:23:03

标签: ruby-on-rails

我是创建项目的。在开发模式下工作!优秀!

DEVELOPMENT: 输入:ruby lib/scripts/test_sync.rb

我的剧本有效!

PRODUCTION: 输入:ruby lib/scripts/test_sync.rb

获取Access denied for user 'root'@'localhost' (using password: YES)

不知道,我做了一切。授予优惠权,更改密码等等......请问库尔有人帮帮我吗?

UPD *

# SQLite version 3.x
#   gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
  adapter:  mysql  
  host:     localhost    
  database: survey_development 
  username: root
  password:  
  encoding: utf8        

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter:  mysql  
  host:     localhost    
  database: survey_development 
  username: root
  password: 
  encoding: utf8

production:
  adapter:  mysql  
  host:     survey
  database: survey_production
  username: survey
  password:
  encoding: utf8

mossad:
  adapter:  mysql  
  host:     baza
  database: baza_production
  username: baza_survey
  password: 
  encoding: utf8

2 个答案:

答案 0 :(得分:0)

尝试添加RAILS_ENV =生产

答案 1 :(得分:0)

您的登录名/密码对于database.yml中的MySql数据库不正确。

修改

如果密码行不存在,则应将其删除:

production:
  adapter:  mysql  
  host:     survey
  database: survey_production
  username: survey
  encoding: utf8