2011-11-21 2 views
3

나에게 Heroku에 생산 응용 프로그램이 있었다 - productionapp.heroku.com 그래서Heroku가 스테이징 응용 프로그램이 충돌한다 (이 환경을 읽을 수 없습니다/staging.rb)

을, 나는 그것을 위해 준비 응용 프로그램을 만드는 단계를 따라 :

2011-11-21T17:43:23+00:00 app[web.1]: 
You did not specify how you would like Rails to report deprecation notices for your staging environment, 
please set config.active_support.deprecation to :log, :notify or :stderr at config/environment 

2011-11-21T17:43:24+00:00 app[web.1]: 
/app/.bundle/gems/ruby/1.9.1/gems/mongoid-2.3.3/lib/mongoid/railtie.rb:64:in `block in <class:Railtie>': 
undefined method `values' for nil:NilClass (NoMethodError) 

2011-11-21T17:43:24+00:00 app[web.1]: 
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec' 

2011-11-21T17:43:24+00:00 app[web.1]: 
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run' 

2011-11-21T17:43:24+00:00 app[web.1]: 
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initialize 

내가 시도하고 다시하고 다시 다음 단계를 시도하고 같은 오류가 타격 결국 :

1. heroku create stagingapp --remote staging 
2. heroku config:add RACK_ENV=staging --app stagingapp 
3. heroku addons:add mongohq:free --app stagingapp 
4. In config/mongoid.yml - 
    add 
    staging: 
     uri: <%= ENV['MONGOHQ_URL'] %> 
5. cp config/environments/production.rb config/environments/staging.rb 
6. Add the MONGOHQ_URL in the mongohq.com connection. 
6. git push staging master 

스테이징 응용 프로그램은 계속해서 다음 역 추적과 충돌한다. 나를 도울 수 있다면 좋을 것입니다!

답변

1

난이 mongoid에

YAML.load(ERB.new(File.read(config_file)).result)[Rails.env].values.flatten.any? 
+0

감사 피터, 실패 라인이기 때문에 당신이 제대로 구성을 추가하지 않은 추측 내가 한 모든했다 : 1. CP의 설정/환경/production.rb config/environments/staging.rb 2. staging.rb의 URL을 올바른 준비 서버로 변경합니다. 내가 누락 될 수있는 것이 무엇인지 알지 못합니다. 다시 시도 할 것입니다. – Jamal

+0

당신은 아마도 잘못된 브랜치를 밀고 있거나 자식에게 파일을 추가하지 않았을 것입니다. – phoet