2012-12-06 2 views
2

Heoku에 Publify 블로그를 새로 설치하려고합니다. 모든 것이 내 로컬 컴퓨터에서 제대로 작동합니다.Heroku에 게시 블로그를 배포하면 응용 프로그램 오류가 발생합니다.

그리고 git push heroku master 문제에 대해 아무것도 말을하지 않습니다

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

-----> Heroku receiving push 
-----> Ruby/Rails app detected 
-----> Installing dependencies using Bundler version 1.2.2 
     Running: bundle install --without development:test --path 
     vendor/bundle --binstubs bin/ --deployment 

     Using rake (10.0.2) 

     ... (edited out list of gems being used) 

     Your bundle is complete! It was installed into ./vendor/bundle 
     Cleaning up the bundler cache. 
-----> Writing config/database.yml to read from DATABASE_URL 
-----> Rails plugin injection 
     Injecting rails_log_stdout 
     Injecting rails3_serve_static_assets 
-----> Discovering process types 
     Procfile declares types  -> (none) 
     Default types for Ruby/Rails -> console, rake, web, worker 
-----> Compiled slug size: 10.7MB 
-----> Launching... done, v7 
     http://desolate-harbor-2909.herokuapp.com deployed to Heroku 

To [email protected]:desolate-harbor-2909.git 
    cea2c5c..efb4eb2 master -> master 

을하지만 그 후 나는 앱 페이지에서이 참조 :
오류가 응용 프로그램에서 발생 하고 페이지 수

응용 프로그램 오류 제공되지 않습니다. 잠시 후 다시 시도하십시오.

응용 프로그램 소유자 인 경우 자세한 내용은 로그를 확인하십시오. 이 보여주는

와 Heroku가 로그 : 내가 잘못 무엇

heroku[slugc]: Slug compilation started 
heroku[api]: Release v7 created by [email protected] 
heroku[api]: Deploy efb4eb2 by [email protected] 
heroku[web.1]: State changed from crashed to starting 
heroku[slugc]: Slug compilation finished 
heroku[web.1]: Starting process with command `bundle exec rails server -p 50812` 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/dsl.rb:7:in `evaluate' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/bin/bundle:14:in `<top (required)>' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/dsl.rb:32:in `instance_eval' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors' 
app[web.1]: There was an error in your Gemfile, and Bundler cannot continue. 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/cli.rb:423:in `exec' 
app[web.1]:  /app/Gemfile:7:in `eval_gemfile' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/dsl.rb:32:in `eval_gemfile' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/definition.rb:18:in `build' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler.rb:144:in `definition' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/vendor/thor/task.rb:27:in `run' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/vendor/thor.rb:275:in `dispatch' 
app[web.1]:  /usr/local/lib/ruby/1.9.1/syck.rb:135:in `load' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/bin/bundle:23:in `load' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/vendor/thor/base.rb:408:in `start' 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/bin/bundle:14:in `block in <top (required)>' 
app[web.1]: /usr/local/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 27, col 0: `adapter = uri.scheme' (ArgumentError) 
app[web.1]:  /app/vendor/bundle/ruby/1.9.1/bin/bundle:23:in `<main>' 
heroku[web.1]: Process exited with status 4 
heroku[web.1]: State changed from starting to crashed 
heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=desolate-harbor-2909.herokuapp.com fwd=171.5.16.142 dyno= queue= wait= connect= service= status=503 bytes= 
heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=desolate-harbor-[2909.herokuapp.com][1] fwd=171.5.16.142 dyno= queue= wait= connect= service= status=503 bytes= 

? 헤로 쿠에 배치하기 전에 어떻게 든 설치해야한다고 생각합니다.

database.yml을 파일은 다음과 같습니다

login: &login 
    adapter: postgresql 
    host: localhost 
    username: ***** 
    password: ***** 

development: 
    database: typo_dev 
    <<: *login 

test: 
    database: typo_tests 
    <<: *login 

production: 
    database: typo 
    <<: *login 

Heroku가 실행 레이크 DB는 : 출력은 마이그레이션 :

Running `rake db:migrate` attached to terminal... up, run.7604 
/usr/local/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 27, col 0: `adapter = uri.scheme' (ArgumentError) 
     /usr/local/lib/ruby/1.9.1/syck.rb:135:in `load' 
     /app/Gemfile:7:in `eval_gemfile' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/dsl.rb:32:in `instance_eval' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/dsl.rb:32:in `eval_gemfile' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/dsl.rb:7:in `evaluate' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/definition.rb:18:in `build' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler.rb:144:in `definition' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/cli.rb:423:in `exec' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/vendor/thor/task.rb:27:in `run' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/vendor/thor.rb:275:in `dispatch' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/vendor/thor/base.rb:408:in `start' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/bin/bundle:14:in `block in <top (required)>' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors' 
     /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.2/bin/bundle:14:in `<top (required)>' 
     /app/vendor/bundle/ruby/1.9.1/bin/bundle:23:in `load' 
     /app/vendor/bundle/ruby/1.9.1/bin/bundle:23:in `<main>' 
There was an error in your Gemfile, and Bundler cannot continue. 
+0

데이터베이스를 구성 했습니까? 그렇다면 구성을 게시 할 수 있습니까? –

+0

실행 했습니까? heroku rake db : migrate? –

+0

Heroku에서'database.url'이'DATABASE_URL에서 읽을 config/database.yml을 쓰는 중 '으로 바뀌 었음에 유의하십시오. [Ruby buildpack] (https://github.com/heroku/heroku-buildpack-ruby/blob/v42/lib/language_pack/ruby.rb#L441-504)을 참조하십시오. – matt

답변

2

을 레일이 database.yml 파일이 실제로 filters it through ERB before loading it as a Yaml file를로드 할 때. Ruby를 사용하여 동적으로 구성을 만들 수 있습니다. 저장소에서 암호를 지키십시오.

레일스 앱을 헤로 쿠로 푸시하면 a new database.yml file is created, replacing the original입니다. 이 새로운 database.yml은 ERB를 사용하여 DATABASE_URL 환경 변수에서 구성을 구성하므로 실제로는 "순수한"Yaml 파일이 아닙니다. database.yml.erb과 같은 것으로 간주 할 수 있습니다.

Typo loads the database.yml file의 Gemfile 다음에 parses it as Yaml이지만 ERB를 통해 먼저 먹이지 않습니다. 보고있는 오류는 Yaml 파서가 파일을 읽지 만 유효한 Yaml이 아닌 ERB이므로 실패합니다.

수정하려면 database.yml 파일이 Yaml로 읽히기 전에 ERB를 통과해야합니다.

require 'erb' 
conf = YAML.load(ERB.new(File.read(dbfile)).result) 

Gemfile 변화 라인

conf = YAML.load(File.read(dbfile)) 

에서 당신은 오타에 대한 버그 리포트를 열거 나 심지어 풀 요청을 보낼 수 있습니다.

+0

Rakefile이 아니라 Gemfile이 오타가 있습니다. 그것 이외에, 이것은 나를 위해 일했다. 감사. –

+0

@JanWrobel 감사합니다! 결정된. – matt

관련 문제