在部署后尝试打开Heroku应用程序时,出现以下错误:
应用程序中发生错误,无法提供您的页面。请稍后重试。 如果您是应用程序所有者,请查看日志以获取详细信息。 一个 这是heroku日志:
2013-12-02T17:20:35.252948+00:00 heroku[web.1]: State changed from crashed to st
arting
2013-12-02T17:20:39.605491+00:00 heroku[web.1]: Starting process with command `b
in/rails server -p 34424 -e $RAILS_ENV`
2013-12-02T17:21:00.611261+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/
activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require': No such
file to load -- spec_helper (LoadError)
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in
require'
2013-12-02T17:21:00.609423+00:00 app[web.1]: => Run `rails server -h` for more s
tartup options
2013-12-02T17:21:00.609423+00:00 app[web.1]: => Booting WEBrick
2013-12-02T17:21:00.609423+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-12-02T17:21:00.609423+00:00 app[web.1]: => Rails 4.0.1 application starting
in production on http://0.0.0.0:34424
2013-12-02T17:21:00.609423+00:00 app[web.1]: Exiting
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in
require'
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_depe
ndency'
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/app/models/user_spec.r
b:1:in `<top (required)>'
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_depe
ndency'
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
2013-12-02T17:21:00.611424+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:289:in `depend_on
'
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
2013-12-02T17:21:00.611261+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:330:in `require_o
r_load'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/engine.rb:462:in `each'
2013-12-02T17:21:00.611424+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:207:in `require_d
ependency'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/engine.rb:464:in `each'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/engine.rb:464:in `block in eager_load!'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/engine.rb:465:in `block (2 levels) in eager_loa
d!'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/engine.rb:462:in `eager_load!'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/application/finisher.rb:56:in `block in <module
:Finisher>'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `instance_exec'
2013-12-02T17:21:00.611794+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/initializable.rb:55:in `block in run_initialize
rs'
2013-12-02T17:21:00.611794+00:00 app[web.1]: from /app/vendor/ruby-1.9.3/lib/
ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_componen
t'
2013-12-02T17:21:00.611794+00:00 app[web.1]: from /app/vendor/ruby-1.9.3/lib/
ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/application/finisher.rb:56:in `each'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/engine.rb:347:in `eager_load!'
2013-12-02T17:21:00.611794+00:00 app[web.1]: from /app/vendor/ruby-1.9.3/lib/
ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
2013-12-02T17:21:00.611643+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `run'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/vendor/ruby-1.9.3/lib/
ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/vendor/ruby-1.9.3/lib/
ruby/1.9.1/tsort.rb:180:in `each'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/application.rb:215:in `initialize!'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/initializable.rb:54:in `run_initializers'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/vendor/ruby-1.9.3/lib/
ruby/1.9.1/tsort.rb:148:in `tsort_each'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/config/environment.rb:
5:in `<top (required)>'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/vendor/ruby-1.9.3/lib/
ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/config.ru:3:in `requir
e'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2013-12-02T17:21:00.612216+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2013-12-02T17:21:00.612216+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2013-12-02T17:21:00.612216+00:00 app[web.1]: from /app/config.ru:in `new'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/config.ru:in `<main>'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2013-12-02T17:21:00.612045+00:00 app[web.1]: from /app/config.ru:3:in `block
in <main>'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/commands/server.rb:75:in `start'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/commands/server.rb:48:in `app'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2013-12-02T17:21:00.612603+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/commands.rb:71:in `<top (required)>'
2013-12-02T17:21:00.612447+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/commands.rb:76:in `block in <top (required)>'
2013-12-02T17:21:00.612603+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9
.1/gems/railties-4.0.1/lib/rails/commands.rb:71:in `tap'
2013-12-02T17:21:00.612603+00:00 app[web.1]: from bin/rails:4:in `require'
2013-12-02T17:21:00.612830+00:00 app[web.1]: from bin/rails:4:in `<main>'
2013-12-02T17:21:02.231250+00:00 heroku[web.1]: Process exited with status 1
2013-12-02T17:21:02.244006+00:00 heroku[web.1]: State changed from starting to c
rashed
C:\Sites\rails_projects\sample_app>
Gemfile:
source 'https://rubygems.org'
ruby '1.9.3'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.1'
gem 'bootstrap-sass', '2.3.2.0'
gem 'bcrypt-ruby', '3.1.2'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
group :development, :test do
gem 'sqlite3', '1.3.8'
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
答案 0 :(得分:3)
我知道在整个日志输出中很难看到,但您收到的真实错误消息是No such file to load -- spec_helper (LoadError)
,而且来自app/models/user_spec.rb:1
。
您是否有理由将user_spec
文件放在app/models
目录中?通常,模型测试位于spec/models
目录中。默认情况下,应用程序在启动时会加载app
目录下的每个文件,通常您不希望在应用程序中加载测试文件。
答案 1 :(得分:0)
显然你的应用程序崩溃了。它是否在开发中运行?尝试在开发计算机上运行rails s -e production
以便更轻松地进行调试。