问题描述
我在FreeBSD上安装了Apache 2和passenger.为了进行测试,我使用标准的Rails new test_app创建了一个测试应用程序.当我尝试通过Apache访问该站点时,如果在test_app目录中运行Rails服务器,则在production.log中的上面的标题中列出了错误.
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.
推荐答案
在apache中,当运行Rails服务器时,它以生产模式与开发模式运行.您可能在database.yml中存在用于生产的错误信息,或者尚未运行rake db:create.检查config/database.yml并确保生产环境下的设置正确,如果正确,请运行rake db:create和rake db:migrate.
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.
这篇关于SQLite3:CantOpenException(无法打开数据库文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!