简体   繁体   English

Rails Bootstrap Devise Cancan Passenger Ubuntu部署

[英]Rails Bootstrap Devise Cancan Passenger Ubuntu deployment

I've successfully installed Nginx and Passenger then made them run together to run Rails but I'm getting below error in my log 我已经成功安装了Nginx和Passenger,然后让它们一起运行以运行Rails,但是我的日志中出现了以下错误

Connecting to database specified by database.yml
Started GET "/" for 111.222.333.444 at 2013-08-07 19:44:43 +1000
Processing by HomeController#index as HTML
Completed 500 Internal Server Error in 1ms

ActiveRecord::StatementInvalid (Could not find table 'users'):
  app/controllers/home_controller.rb:3:in `index'

I've already run 我已经跑了

rake db:migrate
rake db:seed

I also tried 我也试过

rake db:migrate RAILS_ENV="production"
rake db:seed RAILS_ENV="production"

But I'm getting same error. 但是我遇到了同样的错误。

I've tried to look at Nginx configurations which was installed via rvmsudo but this seems to be ok. 我试图查看通过rvmsudo安装的Nginx配置,但这似乎还可以。 Also Passenger was installed using gem and Nginx is preloading Passenger hence why I'm getting the 500 error page from Rails. 另外,Passenger是使用gem安装的,并且Nginx正在预加载Passenger,因此为什么我从Rails那里得到了500错误页面。

What could be wrong? 有什么事吗

http {
    passenger_root /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10;
    passenger_ruby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby;

    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip  on;

    server {
        listen       80;
        server_name  rails_test.dev;

        passenger_enabled on;

        root /var/www/rails_test/public;
        charset utf-8;

        rails_env production;
}

passenger_pre_start http://rails_test.dev;

I found the answer! 我找到了答案! The issue was the write permission on tmp/cache folder! 问题是对tmp / cache文件夹具有写权限! I found this out by changing the Nginx rails_env value to development 我发现了这一点,通过改变Nginx的rails_env价值development

Hope this helps people having similar issues with deployment! 希望这有助于在部署方面遇到类似问题的人们!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM