2012-06-09 3 views
0

내 모든 파일은 GitHub : https://github.com/Integralist/Passage에서 찾을 수 있습니다 (단지 내가 작업하고있는 것을 볼 필요가 있기 때문에).Heroku에서 작동하는 기본 Ruby/Sinatra 응용 프로그램을 가져올 수 없습니까?

나는 Heroku에 처음 왔고 Sinatra 앱을 업로드하기위한 지침에 따라 시도했지만 실행되지는 않습니다. 앱 URL을 방문하면 일반 "애플리케이션 오류"메시지가 나타납니다.

내 설정 과정과 같이하고있다은 다음과 같습니다

  • heroku login
  • heroku create --stack cedar

config.ru 파일을 만들고 내용을 추가 ...

require 'app' 
run Sinatra::Application 

만들기 Gemfile 파일 (파일 확장자 없음)을 추가하고 c ontent ...

source 'http://rubygems.org' 
gem 'sinatra', '1.3.2' 
gem 'thin', '1.3.1' 

열기 터미널 (I 맥 OS X를 실행하는거야) 및 실행 : bundle install를 중복 Gemfile하지만 .lock 파일 확장자를 가진이 시간을 생성하기 위해 보인다? web: bundle exec ruby app.rb -p $PORT (app.rb 분명히 내 기본 응용 프로그램 파일의 이름입니다) :이 다른 Gemfile 지금
GEM 
    remote: http://rubygems.org/ 
    specs: 
    daemons (1.1.8) 
    eventmachine (0.12.10) 
    rack (1.4.1) 
    rack-protection (1.2.0) 
     rack 
    sinatra (1.3.2) 
     rack (~> 1.3, >= 1.3.6) 
     rack-protection (~> 1.2) 
     tilt (~> 1.3, >= 1.3.3) 
    thin (1.3.1) 
     daemons (>= 1.0.9) 
     eventmachine (>= 0.12.6) 
     rack (>= 1.0.0) 
    tilt (1.3.3) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    sinatra (= 1.3.2) 
    thin (= 1.3.1) 

그런 다음 나는 Procfile (어떤 파일 확장자)을 생성하지 않으며 내용을 추가 ... 다음과 같은 내용이있다.

나는 Git을 사용하여 관련된 Heroku 레포에 내 파일을 단계/커밋/푸시합니다.

하지만 heroku ps을 실행하면 내가 얻을 ...

=== web: `bundle exec ruby app.rb -p` 
web.1: crashed for 1m 

내가 heroku logs을 실행하면 그때는 좀 ..

2012-06-09T18:35:41+00:00 heroku[slugc]: Slug compilation started 
2012-06-09T18:36:37+00:00 heroku[api]: Add LANG, PATH, RACK_ENV, GEM_PATH config by [email protected] 
2012-06-09T18:36:37+00:00 heroku[api]: Release v2 created by [email protected] 
2012-06-09T18:36:38+00:00 heroku[api]: Release v3 created by [email protected] 
2012-06-09T18:36:38+00:00 heroku[api]: Deploy e26921b by [email protected] 
2012-06-09T18:36:38+00:00 heroku[web.1]: State changed from created to starting 
2012-06-09T18:36:38+00:00 heroku[slugc]: Slug compilation finished 
2012-06-09T18:36:40+00:00 heroku[web.1]: Starting process with command `bundle exec ruby app.rb -p` 
2012-06-09T18:36:41+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/main.rb:15:in `<class:Application>': missing argument: -p (OptionParser::MissingArgument) 
2012-06-09T18:36:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/main.rb:4:in `<module:Sinatra>' 
2012-06-09T18:36:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/main.rb:3:in `<top (required)>' 
2012-06-09T18:36:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra.rb:5:in `require' 
2012-06-09T18:36:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra.rb:5:in `<top (required)>' 
2012-06-09T18:36:41+00:00 app[web.1]: from app.rb:12:in `require' 
2012-06-09T18:36:41+00:00 app[web.1]: from app.rb:12:in `<main>' 
2012-06-09T18:36:42+00:00 heroku[web.1]: Process exited with status 1 
2012-06-09T18:36:42+00:00 heroku[web.1]: State changed from starting to crashed 
2012-06-09T18:36:42+00:00 heroku[web.1]: State changed from crashed to created 
2012-06-09T18:36:42+00:00 heroku[web.1]: State changed from created to starting 
2012-06-09T18:36:44+00:00 heroku[web.1]: Starting process with command `bundle exec ruby app.rb -p` 
2012-06-09T18:36:45+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/main.rb:15:in `<class:Application>': missing argument: -p (OptionParser::MissingArgument) 
2012-06-09T18:36:45+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/main.rb:4:in `<module:Sinatra>' 
2012-06-09T18:36:45+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/main.rb:3:in `<top (required)>' 
2012-06-09T18:36:45+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra.rb:5:in `require' 
2012-06-09T18:36:45+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra.rb:5:in `<top (required)>' 
2012-06-09T18:36:45+00:00 app[web.1]: from app.rb:12:in `require' 
2012-06-09T18:36:45+00:00 app[web.1]: from app.rb:12:in `<main>' 
2012-06-09T18:36:47+00:00 heroku[web.1]: Process exited with status 1 
2012-06-09T18:36:47+00:00 heroku[web.1]: State changed from starting to crashed 
2012-06-09T18:42:09+00:00 heroku[router]: Error H10 (App crashed) -> GET furious-wind-9309.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-06-09T18:42:09+00:00 heroku[router]: Error H10 (App crashed) -> GET furious-wind-9309.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 
2012-06-09T18:42:38+00:00 heroku[router]: Error H10 (App crashed) -> GET furious-wind-9309.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-06-09T18:42:39+00:00 heroku[router]: Error H10 (App crashed) -> GET furious-wind-9309.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 

사람이 문제가 무엇인지 설명 할 수 어떻게 내가 할 수있는 제발 고쳐주세요.

감사합니다.

+0

'app.rb'에 무엇이 있습니까? 'Procfile'을 사용하고 있기 때문에,'config.ru'는 서버를 초기화하지 않습니다.'app.rb'는 ('ruby app.rb' 명령으로)입니다. – redhotvengeance

답변

1
/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/main.rb:15:in `<class:Application>': missing argument: -p (OptionParser::MissingArgument) 

스택 추적에서 오류가 발생했습니다. bundle exec ruby app.rb -p을 실행할 때 -p에 대한 인수가 제공되지 않습니다. bundle exec ruby app.rb -p 3000 (3000 포트에서 실행)과 같은 것이 필요합니다. 아마도 전역 변수 $ PORT가 정의되지 않았습니까?

편집

비록 양식 heroku's docs on the Procfile :

You can reference other environment variables populated by Heroku, most usefully the $PORT variable, in the command. 

raise $PORT.inspect을하고 시도하고 Heroku가로 밀어. 그것은 충돌 할 것이지만,하려고 생각하고있는 것의 더 좋은 그림과 함께 희망을 갖고있다.

+0

Heroku의 역동적 인 특성은 응용 프로그램 용 포트를 전달해야하며 정적으로 사용 가능한 포트가 없기 때문에 Heroku를 사용하면 확실히 $ PORT를 사용해야합니다. – redhotvengeance

+1

[Procfile in the question] (https://github.com/Integralist/Passage/blob/9ea1914ac1edf39a9fa08af7ffa2332b1b453a44/Procfile)을 보면,'$ PORT'는 실제로 질문이 무엇이든간에 모두 빠져 있습니다. – matt

+0

조지 님, @matt가 맞습니다! 그것은 그 문제를 상당히 좁혀줍니다. – redhotvengeance

관련 문제