2013-06-21 37 views
0

我使用Capistrano將我的rails項目導入到nginx服務器。我的項目在我的開發機器上完美運行,但在生產服務器中,瀏覽器顯示「錯誤500」。我試過$納米日誌/ production.log看到錯誤,我得到它,但我刪除了這個文件,現在,服務器說同樣的錯誤,但我沒有看到production.log,現在它不顯示任何錯誤。刪除production.log

我deploy.rb

require "bundler/capistrano" 
require 'new_relic/recipes' 

load "config/recipes/base" 
load "config/recipes/nginx" 
load "config/recipes/nodejs" 
load "config/recipes/unicorn" 
load "config/recipes/postgresql" 
load "config/recipes/rbenv" 
load "config/recipes/monit" 
load "config/recipes/check" 
load "config/recipes/newrelic" 

server "rails.supera.com.br", :web, :app, :db, primary: true 
# server "vagrant.dev",   :web, :app, :db     # Maquina virtual 
# server '54.232.212.216',  :web, :app, :db, primary: true # Amazon server 

set :user, "deployer" 
set :application, "webapp" 
set :deploy_to, "/home/#{user}/rails_apps/#{application}" 
set :deploy_via, :remote_cache 
set :use_sudo, false 

set :scm, "git" 
set :repository, "[email protected]:nicoskaralis/wt_#{application}.git" 
set :branch, "dev" 

default_run_options[:pty] = true 
ssh_options[:forward_agent] = true 

after "deploy", "deploy:cleanup" # keep only the last 5 releases 

# Opções avançadas rbenv 
set :default_environment, { 
    'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" 
} 
set :bundle_flags, "--deployment --quiet --binstubs --shebang ruby-local-exec" 

# Debug rake 
# set :rake, "#{rake} --trace" 

# Criar usuario novo 
# sudo adduser deployer --ingroup admin 
# cat ~/.ssh/id_rsa.pub | ssh [email protected] 'mkdir -p ~/.ssh/ && cat >> ~/.ssh/authorized_keys' 
# echo "deployer ALL=(ALL:ALL) ALL" >> /etc/sudoers 

# Deploy inicial em uma maquina zero 
# cap deploy:install 
# cap deploy:setup 
# cap deploy:cold 

# Deploy de uma nova versão na maquina ja instalada 
# cap deploy 
+0

刪除後是否重新創建* production.log *? –

回答

0

如果你有一個錯誤500,它可能是服務,因爲應用服務器(如乘客)是能夠崩潰之前的Web服務器(nginx的或Apache)顯示頁面或創建日誌。檢查您的Web服務器的日誌(Apache爲/var/log/apache2/)。

這可能是錯誤的,但每次我看到一個錯誤500的軌道應用程序,這是因爲編碼(UTF-8/ASCII)問題。