我已经成功安装了 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'
我已经跑了
rake db:migrate
rake db:seed
我也试过
rake db:migrate RAILS_ENV="production"
rake db:seed RAILS_ENV="production"
但是我遇到了同样的错误。
我试图查看通过安装的 Nginx 配置,rvmsudo
但这似乎没问题。此外,Passenger 是使用安装的gem
,Nginx 正在预加载乘客,因此为什么我从 Rails 获得 500 错误页面。
有什么问题?
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;