Rails控制台,创建新记录所需的密码

时间:2015-07-12 09:35:24

标签: ruby-on-rails

我目前正在尝试在rails上完成关于ruby的教程,当我输入“subject = Subject.new”

时,我在IRB中遇到了这个错误
Mysql2::Error: Access denied for user 'simple_cms'@'localhost' (using password: YES)

当我运行

时,有没有办法将其提供给irb
rails console

解决此问题的最佳方法是什么?

database.yml如下:

default: &default
adapter: mysql2
encoding: utf8
reconnect: false
host: localhost
pool: 5
username: simple_cms
password: mypasshere
socket: /tmp/mysql.sock

development:
  <<: *default
  database: simple_cms_development

  <<: *default
  database: simple_cms_test

production:
  <<: *default
  database: simple_cms_production
  username: simple_cms
  password: <%= ENV['SIMPLE_CMS_DATABASE_PASSWORD'] %>

非常感谢任何帮助!

0 个答案:

没有答案