[英]Rails Production DB not what is in YML
The database exists as I have used it to create the tables however when trying to run the application I get the error ActiveRecord::NoDatabaseError (unknown database 'db/production.sqllite3') 该数据库存在,因为我用它来创建表,但是当尝试运行该应用程序时,出现错误ActiveRecord :: NoDatabaseError(未知数据库'db / production.sqllite3')
Note that the database.yml has the following entries 请注意,database.yml具有以下条目
default: &default
adapter: mysql2
pool: 5
timeout: 5000
host <ip address>
port: 3306
development
<<: *default
database: SCTP_dev
username: <uname>
password: <pwd>
test:
<<: *default
database: SCTP_test
username: <uname>
password: <pwd>
production:
<<: *default
database: SCTP
username: <uname>
password: <pwd>
nowhere do I see db/production.sqlite3 where does the system get the above production DB from?! 我在哪里看不到db / production.sqlite3,系统从哪里获得上述生产数据库?
Thank You for your help. 谢谢您的帮助。 On running rake db:create it complained about the format of the yml file. 在运行rake db:create时,它抱怨yml文件的格式。 it did not like the tabs. 它不喜欢标签。 Replaced the tabs with spaces. 用空格替换了选项卡。 the site works fine. 该网站工作正常。 Looks like if the database.yml file is not formatted correctly the run time rails will go with rails defaults. 看起来如果database.yml文件的格式不正确,则运行时轨道将与轨道默认值一起使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.