簡體   English   中英

將Rails應用程序推送到Heroku后,空白頁

[英]After push the Rails app to Heroku, blank page

首先,我遇到了一個“預編譯”錯誤,並且通過運行此代碼RAILS_ENV=production bundle exec rake assets:precompile已解決它

其次,我需要為在生產模式下運行的數據庫添加以下代碼:

production:
  adapter: postgresql
  encoding: unicode
  host: localhost
  port: 5432
  database: catarse_production
  pool: 5
  username: postgres
  password: password

正如您所見,在執行“ git push heroku master”之后,一切似乎都進行得很順利:

git push heroku master

Counting objects: 88230, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (25243/25243), done.
Writing objects: 100% (88230/88230), 52.07 MiB | 111.00 KiB/s, done.
Total 88230 (delta 61270), reused 88177 (delta 61251)
remote: Git submodules detected, installing:
remote: 
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.1.2
remote: -----> Installing dependencies using 1.9.7
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Fetching gem metadata from rubygems.org/..........
remote:        Fetching version metadata from rubygems.org/...
remote:        Fetching dependency metadata from rubygems.org/..
remote:        Fetching git://github.com/bernat/best_in_place
remote:        Fetching git://github.com/catarse/catarse_api.git
remote:        Fetching git://github.com/catarse/moip-ruby.git
remote:        Fetching git://github.com/catarse/redactor-rails.git
remote:        Installing CFPropertyList 2.3.1
remote:        Installing i18n 0.7.0
remote:        Installing rake 10.4.2
remote:        Installing minitest 5.7.0
remote:        Installing thread_safe 0.3.5
remote:        Installing erubis 2.7.0
remote:        Installing rack 1.5.3
remote:        Installing mime-types 2.6.1
remote:        Installing builder 3.2.2
remote:        Installing arel 5.0.1.20140414130214
remote:        Installing json 1.8.2
remote:        Installing addressable 2.3.8
remote:        Installing extlib 0.9.16
remote:        Installing multi_json 1.11.0
remote:        Installing redcarpet 3.2.3
remote:        Installing browser 0.8.0
remote:        Using bundler 1.9.7
remote:        Installing thor 0.19.1
remote:        Installing hike 1.2.3
remote:        Installing rinku 1.5.1
remote:        Installing crack 0.1.8
remote:        Installing tilt 1.4.1
remote:        Installing excon 0.45.3
remote:        Installing bcrypt 3.1.10
remote:        Installing netrc 0.10.3
remote:        Installing libxml-ruby 2.8.0
remote:        Installing chartkick 1.3.2
remote:        Installing chunky_png 1.3.4
remote:        Installing cocoon 1.2.6
remote:        Installing coffee-script-source 1.9.1.1
remote:        Installing execjs 2.5.2
remote:        Installing unf_ext 0.0.7.1
remote:        Installing rb-fsevent 0.9.5
remote:        Installing sass 3.4.14
remote:        Installing connection_pool 2.2.0
remote:        Installing hitimes 1.2.2
remote:        Installing multipart-post 2.0.0
remote:        Installing jwt 1.5.0
remote:        Installing little-plugger 1.1.3
remote:        Installing memoist 0.12.0
remote:        Installing retriable 1.4.1
remote:        Installing mini_portile 0.6.2
remote:        Installing oauth 0.4.7
remote:        Installing multi_xml 0.5.5
remote:        Installing temple 0.7.5
remote:        Installing orm_adapter 0.5.0
remote:        Installing request_store 1.1.0
remote:        Installing ezcrypto 0.7.2
remote:        Installing sax-machine 1.3.2
remote:        Installing formatador 0.2.5
remote:        Installing net-ssh 2.9.2
remote:        Installing ipaddress 0.8.0
remote:        Installing inflecto 0.0.2
remote:        Installing hashie 3.4.1
remote:        Installing high_voltage 2.3.0
remote:        Installing htmlentities 4.3.3
remote:        Installing http_accept_language 2.0.5
remote:        Installing httpclient 2.6.0.1
remote:        Installing curb 0.8.8
remote:        Installing mini_magick 4.2.7
remote:        Installing mixpanel-ruby 2.1.0
remote:        Installing newrelic_rpm 3.12.0.288
remote:        Installing ffi 1.9.8
remote:        Installing rails_serve_static_assets 0.0.4
remote:        Installing rails_stdout_logging 0.0.3
remote:        Installing kgio 2.9.3
remote:        Installing redis 3.2.1
remote:        Installing ruby-ole 1.2.11.8
remote:        Installing valuable 0.9.9
remote:        Installing state_machine 1.2.0
remote:        Installing weekdays 1.0.2
remote:        Installing fission 0.5.0
remote:        Installing tzinfo 1.2.2
remote:        Installing rack-test 0.6.3
remote:        Installing warden 1.2.3
remote:        Installing heroku-deflater 0.5.3
remote:        Installing mail 2.6.3
remote:        Installing launchy 2.4.3
remote:        Installing autoparse 0.3.3
remote:        Installing auto_html 1.6.4
remote:        Installing httparty 0.6.1
remote:        Installing sprockets 2.12.3
remote:        Installing mailchimp-api 2.0.6
remote:        Installing coffee-script 2.4.1
remote:        Installing uglifier 2.7.1
remote:        Installing unf 0.1.4
remote:        Installing compass-core 1.0.3
remote:        Installing compass-import-once 1.0.5
remote:        Installing timers 4.0.1
remote:        Installing faraday 0.9.1
remote:        Installing logging 2.0.0
remote:        Installing pg 0.17.1
remote:        Installing slim 3.0.3
remote:        Installing net-scp 1.2.1
remote:        Installing omniauth 1.2.2
remote:        Installing video_info 2.4.2
remote:        Installing raindrops 0.13.0
remote:        Installing rb-inotify 0.9.5
remote:        Installing rails_12factor 0.0.3
remote:        Installing ethon 0.7.3
remote:        Installing redis-namespace 1.5.2
remote:        Installing activesupport 4.1.10
remote:        Installing domain_name 0.5.24
remote:        Installing spreadsheet 1.0.3
remote:        Installing celluloid 0.16.0
remote:        Installing oauth2 1.0.0
remote:        Installing signet 0.6.0
remote:        Installing omniauth-oauth 1.1.0
remote:        Installing fog-core 1.30.0
remote:        Installing compass 1.0.3
remote:        Installing typhoeus 0.7.1
remote:        Installing actionview 4.1.10
remote:        Installing activemodel 4.1.10
remote:        Installing enumerate_it 1.2.8
remote:        Installing i18n_alchemy 0.2.1
remote:        Installing pundit 1.0.1
remote:        Installing http-cookie 1.0.2
remote:        Installing to_xls 1.5.3
remote:        Installing sidekiq 3.1.4
remote:        Installing omniauth-oauth2 1.3.0
remote:        Installing googleauth 0.4.1
remote:        Installing omniauth-twitter 1.2.0
remote:        Installing fog-json 1.0.1
remote:        Installing fog-local 0.2.1
remote:        Installing fog-vmfusion 0.1.0
remote:        Installing compass-960-plugin 0.10.4
remote:        Installing mixpanel_client 4.1.2
remote:        Installing actionpack 4.1.10
remote:        Installing active_model_serializers 0.8.0
remote:        Installing activerecord 4.1.10
remote:        Installing carrierwave 0.10.0
remote:        Installing rails-observers 0.1.2
remote:        Installing protected_attributes 1.0.9
remote:        Installing spectator-validates_email 0.2.0
remote:        Installing rest-client 1.8.0
remote:        Installing omniauth-facebook 2.0.1
remote:        Installing google-api-client 0.8.6
remote:        Installing fog-brightbox 0.7.1
remote:        Installing fog-sakuracloud 1.0.1
remote:        Installing fog-serverlove 0.1.2
remote:        Installing fog-softlayer 0.4.6
remote:        Installing fog-storm_on_demand 0.1.1
remote:        Installing actionmailer 4.1.10
remote:        Installing nokogiri 1.6.6.2
remote:        Installing has_scope 0.6.0
remote:        Installing kaminari 0.16.3
remote:        Installing railties 4.1.10
remote:        Installing sprockets-rails 2.3.1
remote:        Installing draper 2.1.0
remote:        Installing routing-filter 0.4.0.1
remote:        Installing simple_form 3.1.0
remote:        Installing pg_search 1.0.3
remote:        Installing ranked-model 0.4.0
remote:        Installing schema_plus 1.8.9
remote:        Installing pagarme 1.9.9
remote:        Installing mail_form 1.5.1
remote:        Using best_in_place 3.0.0.alpha from git://github.com/bernat/best_in_place (at ee95961)
remote:        Installing unicorn 4.9.0
remote:        Installing google_drive 1.0.1
remote:        Using moip 1.0.2 from git://github.com/catarse/moip-ruby.git (at c0225ad)
remote:        Installing fog-xml 0.1.2
remote:        Installing loofah 2.0.2
remote:        Installing coffee-rails 4.1.0
remote:        Installing responders 1.1.2
remote:        Installing slim-rails 3.0.1
remote:        Installing jquery-rails 3.1.2
remote:        Installing sass-rails 5.0.1
remote:        Installing fog-atmos 0.1.0
remote:        Installing rails 4.1.10
remote:        Installing fog-ecloud 0.1.1
remote:        Installing fog-powerdns 0.1.1
remote:        Installing fog-google 0.0.5
remote:        Installing fog-aws 0.4.0
remote:        Installing fog-profitbricks 0.0.2
remote:        Installing fog-radosgw 0.0.4
remote:        Installing fog-riakcs 0.1.0
remote:        Installing fog-terremark 0.1.0
remote:        Installing fog-voxel 0.1.0
remote:        Installing inherited_resources 1.6.0
remote:        Installing feedjira 1.6.0
remote:        Using catarse_api 0.0.1 from git://github.com/catarse/catarse_api.git (at master)
remote:        Installing devise 3.5.1
remote:        Installing compass-rails 2.0.4
remote:        Installing catarse_monkeymail 0.1.6
remote:        Installing catarse_moip 3.2.0
remote:        Installing catarse_settings_db 0.1.1
remote:        Installing postgres-copy 0.9.2
remote:        Installing dbhero 1.1.6
remote:        Installing user_notifier 0.0.5
remote:        Using redactor-rails 0.5.0 from git://github.com/catarse/redactor-rails.git (at master)
remote:        Installing catarse_pagarme 2.6.8
remote:        Installing fog 1.30.0
remote:        Bundle complete! 85 Gemfile dependencies, 192 gems now installed
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Post-install message from httparty:
remote:        When you HTTParty, you must party hard!
remote:        Post-install message from compass:
remote:        Compass is charityware. If you love it, please donate on our behalf at umdf.org/compass Thanks!
remote:        Bundle completed (365.51s)
remote:        Cleaning up the bundler cache.
remote:        Detected manifest file, assuming assets were compiled locally
remote: 
remote: -----> Discovering process types
remote:        Procfile declares types -> web, worker
remote:        Default types for Ruby  -> console, rake
remote: 
remote: -----> Compressing... done, 58.7MB
remote: -----> Launching... done, v5
remote:        shrouded-stream-3654.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy..... done.
To git.heroku.com/shrouded-stream-3654.git
 * [new branch]      master -> master

但是,現在Heroku上的應用程序只是一個空白頁面,我不知道該如何解決。 您可以通過以下鏈接檢查該應用程序: https : //shrouded-stream-3654.herokuapp.com/

謝謝您的幫助!

您的錯誤日志產生:

Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml` (RuntimeError)

您可以通過將config / secrets.yml添加到版本控制中,然后再次進行部署來解決此問題(在此處詳細說明: 如何解決錯誤“針對“生產”環境缺少“ secret_key_base”的問題”(Rails 4.1)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM