Rails的引导设计惨惨客运Ubuntu的部署
问题描述:
我已经成功地安装的Nginx和乘客,然后让他们跑起来运行Rails,但我发现下面的错误在我的日志Rails的引导设计惨惨客运Ubuntu的部署
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"
但我发现了同样的错误。
我试着看看通过rvmsudo
安装的Nginx配置,但这似乎是好的。此外,Passenger使用gem
安装,Nginx正在预加载Passenger,因此我从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;
答
我找到了答案!问题在于tmp/cache文件夹的写入权限! 我发现通过更改Nginx rails_env
值到development
希望这可以帮助人们有类似的部署问题!
你是如何安装乘客并将其配置为与nginx一起工作的?你能否从nginx向乘客显示你的配置? –
用nginx conf更新。乘客安装了宝石 –
一些shell在命令后不喜欢环境变量。尝试运行'export RAILS_ENV = production',然后运行'rake db:migrate'等。 –