我成功地向Heroku部署了一个应用程序。我为联系表单添加了一些代码,现在应用程序将无法启动。奇怪的是,如果我取出联系表格代码,它仍然无法启动。我得到的Heroku日志错误是:
2016-02-05T02:02:11.535460+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
2016-02-05T02:02:11.535461+00:00 app[web.1]: from bin/rails:9:in `<main>'
2016-02-05T02:02:12.518255+00:00 heroku[web.1]: State changed from starting to crashed
2016-02-05T02:02:12.496744+00:00 heroku[web.1]: Process exited with status 1
2016-02-05T02:02:14.019377+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=camdhall.herokuapp.com request_id=f0b71059-686b-46f4-9e69-2e62d55ca998 fwd="216.165.95.2" dyno= connect= service= status=503 bytes=
rails控制台返回此(我不知道为什么MailForm未初始化,因为它在我的联系人控制器中是正确的):
/app/app/models/contact.rb:1:in `<top (required)>': uninitialized constant MailForm (NameError)
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:471:in `each'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:471:in `block in eager_load!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:469:in `each'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:469:in `eager_load!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:346:in `eager_load!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/application/finisher.rb:56:in `each'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
from /app/config/environment.rb:5:in `<top (required)>'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/application.rb:328:in `require'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/application.rb:328:in `require_environment!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:142:in `require_application_and_environment!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:67:in `console'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
from /app/bin/rails:9:in `require'
from /app/bin/rails:9:in `<main>'
我运行heroku时收到的消息是:
GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
我不知道出了什么问题。我尝试重新安装postgres,重新启动应用程序,运行rake db:migrate并检查错别字代码,但我很遗憾。它在我的本地设置上运行,但不在生产中运行。