我正在建立一个基本的 RoR 应用程序。我所有的数据库都是 MySQL 和本地的,包括我的数据库,yml 文件。我正在尝试访问基本视图,但仍然收到 ActiveRecord::ConnectionNotEstablished 错误。我究竟做错了什么?
# database.yml
development:
adapter: mysql2
encoding: utf8
database: *****_dev
username: ****
password: *****
host: 127.0.0.1
port: 3306
# 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: mysql2
encoding: utf8
database: *****_test
username: ****
password: *****
host: 127.0.0.1
port: 3306
production:
adapter: mysql2
encoding: utf8
database: *****_prod
username: ****
password: *****
host: 127.0.0.1
port: 3306
gem文件中的MySQL2:
gem 'mysql2', '~>0.3.10'
所以当输入:http://localhost:3000/controller/view
我得到:ActiveRecord::ConnectionNotEstablished
我还可以包括哪些有用的信息?
提前致谢。