Apache,Centos,Passenger SQLite3问题

时间:2014-08-14 10:14:39

标签: ruby-on-rails apache passenger

我正在尝试使用Apache在Centos上运行Rails应用程序 我在浏览器中收到此消息:

We're sorry, but something went wrong.

查看httpd日志,我发现有一个SQLite3问题。有什么想法吗?

环境:

Centos 6.5
64bit
Apache 2.2.15
ruby 2.0.0p481
Rails 4.0.5
passenger 4.0.48

Apache错误日志

App 18313 stdout:
[ 2014-08-14 12:34:09.1836 18254/7f0c89077700 Pool2/SmartSpawner.h:298 ]: Preloader for /var/www/html/masterbet_20140813 started on PID 18313, listening on unix:/tmp/p$

App 18402 stdout:
App 18402 stdout: Started GET "/" for 192.168.1.10 at 2014-08-14 12:34:09 +0300

App 18402 stdout: Processing by StaticPagesController#home as HTML

App 18402 stdout: SQLite3::SQLException: no such table: users: SELECT  "users".* FROM "users"  WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd807$

App 18402 stdout: Completed 500 Internal Server Error in 3ms
App 18402 stdout:

App 18402 stdout: ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: users: SELECT  "users".* FROM "users"  WHERE "users"."remember_token" = 'da39a3$

App 18402 stdout:   app/helpers/sessions_helper.rb:42:in `current_user'
App 18402 stdout:   app/helpers/sessions_helper.rb:15:in `signed_in?'
App 18402 stdout:   app/controllers/static_pages_controller.rb:4:in `home'

Apache etc / httpd / conf / httpd.conf

   <VirtualHost *:80>
      ServerName www.masterbet.gr
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /var/www/html/masterbet_20140813/public
      <Directory /var/www/html/masterbet_20140813/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
         # Uncomment this if you're on Apache >= 2.4:
         #Require all granted
      </Directory>
   </VirtualHost>

1 个答案:

答案 0 :(得分:1)

当我尝试通过乘客使用apache进行我的rails应用程序时遇到了同样的问题。如果您已经初始化了一个或初始化生产数据库,那么您似乎需要指向您的开发数据库,​​因为您在默认情况下通过apache部署应用程序时处于生产模式。 转到config / database.yml文件并更改生产的默认配置:database:db / production.sqlite3 to database:db / development.sqlite3如果您已准备好开发db。如果不是,你应该运行rake db:migrate并填充生产数据库。