SQLite3:CantOpenException (unable to open database file)

扶醉桌前 提交于 2019-12-22 08:16:03

问题


I have FreeBSD setup with Apache 2 and passenger. To test things out I created a test app using the standard Rails new test_app. When I try to access the site through Apache I get the error listed in the title above in the production.log, if I run the Rails server from the test_app directory it works fine.

I only have one controller and view in the app right now just a home controller and index view, I am not even accessing a database.


回答1:


In apache, it's running in production mode vs. development mode when running rails server. You probably have either incorrect information in your database.yml for production, or haven't run rake db:create yet. Check your config/database.yml and make sure the settings under production are correct, and if so, run rake db:create and rake db:migrate.




回答2:


Is your server running at the same time? I ve got an error and it disappeared when I stopped server.



来源:https://stackoverflow.com/questions/5454089/sqlite3cantopenexception-unable-to-open-database-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!