简体   繁体   English

Rails Production DB不是YML中的内容

[英]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.

相关问题 在Rails生产中使用什么数据库? - What database to use in production with Rails? Rails AppSync将“登台”数据库与“生产”同步 - Rails App- Sync “staging” db with “production” Ruby on Rails database.yml中的socket声明是什么? - What is the socket declaration for, in Ruby on Rails database.yml? 如何将生产数据存储到Rails应用程序中的报表数据库? - How to to store production data to a reporting DB in a Rails app? 只使用开发mysql db,而不是在rails中测试或生产 - only using development mysql db, not test or production in rails 如何将数据从生产数据库迁移到开发数据库(第4条)? - How do I migrate data from production db to development db (Rails 4)? 使用rails选择什么数据库。 大分贝 - What db to chose, using rails. Large db 用rails更好地将geoip资源保存在同一数据库或分离的数据库中? - rails what is better to save geoip resources in same db or in separated db? `socket`声明在Rails应用程序的database.yml文件中做什么? - What does the `socket` declaration do in the database.yml file of a rails app? RAIL_ENV =生产rake db:schema:使用rails 3.1.0和ubuntu 10.04加载中止 - RAIL_ENV=production rake db:schema:load aborted with rails 3.1.0 and ubuntu 10.04
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM