2013-02-24 75 views
0

我的應用程序在本地完美地工作,我看到沒有錯誤,當我輸入git push heroku master。然而,當我鍵入Heroku的開放和訪問URL我看到:heroku應用程序崩潰,但本地偉大工程

應用程序錯誤

在應用程序中出現錯誤,你的頁面無法送達。請稍後重試。 如果您是應用程序所有者,請查看日誌以獲取詳細信息。

在Heroku的日誌中我得到以下幾點:

2013-02-24T08:57:38+00:00 heroku[web.1]: Process exited with status 1 
2013-02-24T08:57:38+00:00 heroku[web.1]: State changed from starting to crashed 
2013-02-24T08:59:21+00:00 heroku[web.1]: State changed from crashed to starting 
2013-02-24T08:59:23+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 15485` 
2013-02-24T08:59:30+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-02-24T08:59:30+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-02-24T08:59:33+00:00 app[web.1]: => Booting WEBrick 
2013-02-24T08:59:33+00:00 app[web.1]: => Rails 3.2.11 application starting in production on http://0.0.0.0:15485 
2013-02-24T08:59:33+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-02-24T08:59:33+00:00 app[web.1]: Exiting 
2013-02-24T08:59:33+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:317:in `rescue in depend_on': No such file to load -- spec_helper (LoadError) 
2013-02-24T09:04:16+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=whispering-journey-9991.herokuapp.com fwd="108.46.218.98" dyno= queue= wait= connect= service= status=503 bytes= 

有一個負載錯誤,我沒有帶管理一些自嘲的警告來修復。我只是更新到軌3.2.11不知道它是否相關。

的Gemfile:

source 'https://rubygems.org' 

gem 'rails', '3.2.11' 
gem 'bootstrap-sass', '2.0.4' 
gem 'bcrypt-ruby', '3.0.1' 
gem 'faker', '1.0.1' 
gem 'will_paginate', '3.0.3' 
gem 'bootstrap-will_paginate', '0.0.6' 
gem 'jquery-rails', '2.0.2' 
gem 'pg', '0.12.2' 
gem 'rails_autolink', '~> 1.0.9' 
gem 'rinku', '~> 1.5.0', :require => 'rails_rinku' 
gem 'auto_html', '1.6.0' 
gem 'acts_as_votable', '~> 0.4.0' 
gem 'thumbs_up', '~> 0.6.2' 


group :development, :test do 
    gem 'rspec-rails', '2.11.0' 
end 

group :development do 
    gem 'annotate', '2.5.0' 
end 

group :assets do 
    gem 'sass-rails', '3.2.5' 
    gem 'coffee-rails', '3.2.2' 
    gem 'uglifier', '1.2.3' 
end 

group :test do 
    gem 'factory_girl_rails', '4.1.0' 
    gem 'capybara', '1.1.2' 
    gem 'cucumber-rails', '1.2.1', :require => false 
    gem 'database_cleaner', '0.7.0' 
end 

這是第一次即時推送到Heroku的這個(新)電腦不知道這是否有助於問題上。

我打字混帳推Heroku的時候也出現此錯誤:

Running: rake assets:precompile 
    rake aborted! 
    could not connect to server: Connection refused 
    Is the server running on host "127.0.0.1" and accepting 
    TCP/IP connections on port 5432? 

現在尋找到:https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar

+1

http://eveningsamurai.wordpress.com/2011/02/02/no-such-file-to-load-spec_helper/ – SGalea 2013-02-24 09:30:00

+0

$ rails生成rspec:install>相同.rspec存在規格相同spec/spec_helper.rb – Jaqx 2013-02-24 09:31:15

+0

你能在本地運行「bundle install --without development test」,然後運行「bundle exec rails s」?同樣的錯誤? – 2013-02-24 11:30:01

回答

1

看起來你使用的是默認的WEBrick服務器。 Heroku建議使用「瘦」服務器。嘗試在你的Gemfile添加這樣的事情:

gem 'thin', :group => :production 

然後運行捆綁安裝,使用Git提交的文件,並再次推到你的Heroku應用。 如果您還沒有這樣做,你需要在你的命令行tryping以下預編譯的資產:

RAILS_ENV=production bundle exec rake assets:precompile 

然後,不要忘了運行git的命令:

git add . 
git commit -m "added precompiled assets" 
git push heroku master 
+0

不知道這是否會做任何事情,因爲一個月前heroku曾經爲我工作,我從來沒有用過瘦,但我會嘗試你的建議 – Jaqx 2013-02-24 19:31:42

+0

做了解決嗎? – thewheelz 2013-02-26 01:00:17

+0

nope,但我仍然會繼續使用瘦身 – Jaqx 2013-02-26 01:05:18

相關問題