2013-04-23 4 views
14

새로운 Rails 4 베타 앱을 만들어서 Heroku (Ruby 2.0.0 및 Procfile을 통해 Unicorn 사용)에 배포했습니다.Heroku의 Rails 4 앱은 500ing이지만 로그에는 오류 메시지가 표시되지 않습니다.

foreman start 로컬로 잘 실행,하지만 난 배포 된 응용 프로그램의 홈페이지를 방문 할 때, 난 그냥 표준 Heroku가 500 오류 얻을 :

We're sorry, but something went wrong. 
If you are the application owner check the logs for more information. 

그러나, 로그에, 에 오류가없는을 .

Counting objects: 6, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (4/4), done. 
Writing objects: 100% (4/4), 656 bytes, done. 
Total 4 (delta 2), reused 0 (delta 0) 

-----> Ruby/Rails app detected 
-----> Using Ruby version: ruby-2.0.0 
-----> Installing dependencies using Bundler version 1.3.2 
     Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment 
     Using rake (10.0.4) 
     Using i18n (0.6.4) 
     Using minitest (4.7.3) 
     Using multi_json (1.7.2) 
     Using atomic (1.1.8) 
     Using thread_safe (0.1.0) 
     Using tzinfo (0.3.37) 
     Using activesupport (4.0.0.beta1) 
     Using builder (3.1.4) 
     Using erubis (2.7.0) 
     Using rack (1.5.2) 
     Using rack-test (0.6.2) 
     Using actionpack (4.0.0.beta1) 
     Using mime-types (1.23) 
     Using polyglot (0.3.3) 
     Using treetop (1.4.12) 
     Using mail (2.5.3) 
     Using actionmailer (4.0.0.beta1) 
     Using activemodel (4.0.0.beta1) 
     Using activerecord-deprecated_finders (0.0.3) 
     Using arel (4.0.0) 
     Using activerecord (4.0.0.beta1) 
     Using coffee-script-source (1.6.2) 
     Using execjs (1.4.0) 
     Using coffee-script (2.2.0) 
     Using json (1.7.7) 
     Using rdoc (3.12.2) 
     Using thor (0.18.1) 
     Using railties (4.0.0.beta1) 
     Using coffee-rails (4.0.0) 
     Using hike (1.2.2) 
     Using jbuilder (1.0.2) 
     Using jquery-rails (2.2.1) 
     Using kgio (2.8.0) 
     Using mysql2 (0.3.11) 
     Using bundler (1.3.2) 
     Using tilt (1.3.7) 
     Using sprockets (2.9.3) 
     Using sprockets-rails (2.0.0.rc4) 
     Using rails (4.0.0.beta1) 
     Using raindrops (0.11.0) 
     Using sass (3.2.8) 
     Using sass-rails (4.0.0.rc1) 
     Using turbolinks (1.1.1) 
     Using uglifier (2.0.1) 
     Using unicorn (4.6.2) 
     Your bundle is complete! It was installed into ./vendor/bundle 
     Cleaning up the bundler cache. 
-----> Preparing app for Rails asset pipeline 
     Running: rake assets:precompile 
     I, [2013-04-23T22:28:44.559735 #871] INFO -- : Writing /tmp/build_33m76p0rij8a5/public/assets/rails-d8fb6a2617998f32edf5edb354fc5326.png 
     I, [2013-04-23T22:28:49.911890 #871] INFO -- : Writing /tmp/build_33m76p0rij8a5/public/assets/application-d4a508061cd56ce9e544945495285e0c.js 
     I, [2013-04-23T22:28:50.120141 #871] INFO -- : Writing /tmp/build_33m76p0rij8a5/public/assets/application-a3b89b66a8471f3e75abb239e3b35c7d.css 
     Asset precompilation completed (8.30s) 
-----> Rails plugin injection 
-----> Discovering process types 
     Procfile declares types  -> web 
     Default types for Ruby/Rails -> console, rake, worker 

-----> Compiled slug size: 35.0MB 
-----> Launching... done, v21 
     http://blofs.herokuapp.com deployed to Heroku 

To [email protected]:blofs.git 
    32e51a2..37d989c master -> master 

그리고 여기가 그 푸시의 로그입니다 : 나는 여기에 500

의 원인이 무엇 아무 생각이 내 마지막 git push heroku master에서 출력되지 않습니다했습니다 그 후

2013-04-23T22:28:06.650049+00:00 heroku[slugc]: Slug compilation started 
2013-04-23T22:29:11.194613+00:00 heroku[api]: Release v21 created by [email protected] 
2013-04-23T22:29:11.365908+00:00 heroku[api]: Deploy 37d989c by [email protected] 
2013-04-23T22:29:11.441066+00:00 heroku[web.1]: State changed from up to starting 
2013-04-23T22:29:11.932952+00:00 heroku[slugc]: Slug compilation finished 
2013-04-23T22:29:12.858139+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2013-04-23T22:29:13.194707+00:00 app[web.1]: I, [2013-04-23T22:29:13.194495 #2] INFO -- : reaped #<Process::Status: pid 5 exit 0> worker=0 
2013-04-23T22:29:13.194902+00:00 app[web.1]: I, [2013-04-23T22:29:13.194747 #2] INFO -- : master complete 
2013-04-23T22:29:14.312014+00:00 heroku[web.1]: Process exited with status 0 
2013-04-23T22:29:14.338943+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -p 25281 -E $RACK_ENV` 
2013-04-23T22:29:15.717687+00:00 app[web.1]: I, [2013-04-23T22:29:15.717387 #2] INFO -- : listening on addr=0.0.0.0:25281 fd=7 
2013-04-23T22:29:15.717916+00:00 app[web.1]: I, [2013-04-23T22:29:15.717861 #2] INFO -- : worker=0 spawning... 
2013-04-23T22:29:15.721526+00:00 app[web.1]: I, [2013-04-23T22:29:15.721385 #2] INFO -- : master process ready 
2013-04-23T22:29:15.723623+00:00 app[web.1]: I, [2013-04-23T22:29:15.723389 #5] INFO -- : worker=0 spawned pid=5 
2013-04-23T22:29:15.723805+00:00 app[web.1]: I, [2013-04-23T22:29:15.723750 #5] INFO -- : Refreshing Gem list 
2013-04-23T22:29:16.305653+00:00 heroku[web.1]: State changed from starting to up 
2013-04-23T22:29:16.891063+00:00 app[web.1]: I, [2013-04-23T22:29:16.890882 #5] INFO -- : worker=0 ready 

, 내 브라우저에서 홈페이지를로드하려고 시도했지만 로그에 표시된 두 줄만 추가되었습니다.

2013-04-23T22:29:26.685651+00:00 heroku[router]: at=info method=GET path=/ host=blofs.herokuapp.com fwd="46.65.16.44" dyno=web.1 connect=2ms service=156ms status=500 bytes=706 
2013-04-23T22:29:26.973073+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=blofs.herokuapp.com fwd="46.65.16.44" dyno=web.1 connect=1ms service=5ms status=200 bytes=0 

문제가 무엇인지 알 수있는 사람이 있습니까? 관련이있을 수

다른 것들 :

  • 나는 표준 Heroku가 포스트 그레스 부가 기능을 비활성화했습니다 대신 ClearDB MySQL의 부가 기능을 사용하고 있습니다.
  • var (mysql 중 하나)과 동일한 값으로 수동으로 DATABASE_URL 환경 변수를 이전 값 (postgres addon을 제거한 후에도 여전히 postgres URL)에서 변경하려고 시도했습니다. 이것은 어떤 차이도없는 것처럼 보였다.
  • 내 Gemfile에 ruby '2.0.0'을 추가했으며 mysql2unicorn 보석을 추가했습니다. 그것은 foreman start 로컬로 잘 작동 web: bundle exec unicorn -p $PORT -E $RACK_ENV
  • : 그리고 난 단지 포함 config/unicorn.rbhttps://devcenter.heroku.com/articles/rails-unicorn
  • 내 Procfile에서 제안 사용했습니다.
  • 위에서 설명한 수정 외에도 기본적으로 rails new으로 만든 기본 앱입니다.
+3

heroku rails 4 보석이있는 것처럼 보이지 않습니다. https://devcenter.heroku.com/articles/rails4 –

답변

34

Gemfile에 gem 'rails_12factor'을 추가해야합니다. Heroku에서 임시 픽스를 사용하여 Rails 4+ 서비스를 사용할 수 있습니다.

Getting Started with Rails 4.x on Heroku 또는 Getting Started with Rails 5.x on Heroku을 참조하십시오.

+1

귀하의 문제를 해결하는 열쇠 일 가능성이 높으므로이 대답을 받아 들여야합니다. – MoMolog

+1

전체 디버그 로그를 보려면 production.rb에서'config.log_level = : debug'를 반드시 변경하십시오. –

+0

나를 위해이 작품! 나는 첫째로 그 보석을 추가하고 그 후에 나는 상세한 로그 오류가있다. 그런 다음 'heroku run rake db : migrate'를 실행 한 다음 앱이 작동하고있었습니다! – adripanico

1

이 답변은 오류를 찾을 수 있도록 로그를 켜는 방법을 알려주지 만 실제로 '이 잘못 될 수 있습니까?'라는 질문에 실제로 답변하지 않습니다. this question에 @Lauren로 대답 제안에서 별도로

, 여기에 또 다른 가능성은 - 당신은 또한 매우 조용한 (500) 오류가 발생합니다 즉, 생산 환경에서 ENV 일정에 액세스를 시도하고 heroku config:set 통해 설정하지 않은 경우 .