微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ruby-on-rails – 未定义的方法’arity’导致rails 4部署错误Heroku(H10)

过去2天我已经收到这个错误.我尝试过可能的每一个配置更改解决方案.该应用程序在我的本地环境中工作正常,但似乎只有当我部署到heroku时才崩溃,所以我不知道我的代码是否有任何错误.有人可以建议我下一步做什么这是日志 –
2013-08-06T06:07:57.332143+00:00 app[web.1]: config.eager_load is set to nil. Please 
update your config/environments/*.rb files accordingly:
2013-08-06T06:07:57.332143+00:00 app[web.1]: 
2013-08-06T06:07:57.332143+00:00 app[web.1]:   * development - set it to false
2013-08-06T06:07:57.332143+00:00 app[web.1]:   * production - set it to true
2013-08-06T06:07:57.332143+00:00 app[web.1]:   * test - set it to false (unless you use a tool that preloads your test environment)
2013-08-06T06:07:57.332143+00:00 app[web.1]: 
2013-08-06T06:07:57.433472+00:00 app[web.1]: params or add `protected_attributes` to your Gemfile to use the old one.
2013-08-06T06:07:57.433472+00:00 app[web.1]: `config/application.rb` file and any `mass_assignment_sanitizer` options
2013-08-06T06:07:57.433472+00:00 app[web.1]: from your `config/environments/*.rb` files.
2013-08-06T06:07:57.433472+00:00 app[web.1]: See http://guides.rubyonrails.org/security.html#mass-assignment for more information.
2013-08-06T06:07:57.433472+00:00 app[web.1]: To disable this message remove the `whitelist_attributes` option from your
2013-08-06T06:07:57.433472+00:00 app[web.1]: out of Rails into a gem. Please use the new recommended protection model for
2013-08-06T06:07:57.433472+00:00 app[web.1]:  
2013-08-06T06:07:57.433472+00:00 app[web.1]: 
2013-08-06T06:07:57.433472+00:00 app[web.1]: 
2013-08-06T06:07:57.433472+00:00 app[web.1]: DEPRECATION WARNING: Model based mass assignment security has been extracted
2013-08-06T06:07:58.741762+00:00 app[web.1]: => Booting WEBrick
2013-08-06T06:07:58.742020+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:58 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Application: My Application
2013-08-06T06:07:58.741762+00:00 app[web.1]: => Rails 4.0.0 application starting in production on http://0.0.0.0:41380
2013-08-06T06:07:58.741762+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:58 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Starting the New Relic agent in "production" environment.
2013-08-06T06:07:58.741762+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:58 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : To prevent agent startup add a NEWRELIC_ENABLE=false environment variable or modify the "production" section of your newrelic.yml.
2013-08-06T06:07:58.741762+00:00 app[web.1]: => Run `rails server -h` for more startup options
2013-08-06T06:07:58.741762+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:58 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Reading configuration from config/newrelic.yml
2013-08-06T06:07:58.741762+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-08-06T06:07:58.741762+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:58 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Environment: production
2013-08-06T06:07:58.741762+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:58 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Enabling the Request Sampler.
2013-08-06T06:07:58.741762+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:58 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : dispatcher: webrick
2013-08-06T06:08:04.062061+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/associations/builder/association.rb:29:in `initialize': undefined method `arity' for :custom_type:Symbol (NoMethodError)
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/associations.rb:1401:in `belongs_to'
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/app/models/field.rb:4:in `<class:Field>'
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/app/models/field.rb:1:in `<top (required)>'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/associations/builder/association.rb:12:in `new'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `each'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `each'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `each'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/associations/builder/association.rb:12:in `build'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:347:in `eager_load!'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `eager_load!'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:288:in `depend_on'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/config.ru:3:in `block in <main>'
2013-08-06T06:08:04.062061+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activerecord-deprecated_finders-1.0.3/lib/active_record/deprecated_finders/association_builder.rb:70:in `initialize_with_deprecated_options'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:329:in `require_or_load'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:206:in `require_dependency'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `block in eager_load!'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
2013-08-06T06:08:04.062319+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
2013-08-06T06:08:04.062751+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/config.ru:in `new'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from bin/rails:4:in `require'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
2013-08-06T06:08:04.062906+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from bin/rails:4:in `<main>'
2013-08-06T06:08:04.063055+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2013-08-06T06:08:04.063540+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:59 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Installing deferred Rack instrumentation
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:59 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Installing Rails 4 Controller instrumentation
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:59 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Installing Rails4 Error instrumentation
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:59 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Installing Net instrumentation
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:59 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Installing Rails 4 view instrumentation
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:59 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Finished instrumentation
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:07:59 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Installing ActiveRecord 4 instrumentation
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:08:00 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Reporting to: https://rpm.newrelic.com/accounts/386768/applications/*****
2013-08-06T06:08:04.178658+00:00 app[web.1]: Exiting
2013-08-06T06:08:04.178658+00:00 app[web.1]: ** [NewRelic][08/06/13 06:08:03 +0000 bc4e42fd-685e-4f33-81fe-77ff7b0aa790 (2)] INFO : Starting Agent shutdown
2013-08-06T06:08:05.648375+00:00 heroku[web.1]: Process exited with status 1
2013-08-06T06:08:05.665239+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-06T06:08:08.293497+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=***** fwd="65.128.39.118" dyno= connect= service= status=503 bytes=
2013-08-06T06:08:08.516985+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=***** fwd="65.128.39.118" dyno= connect= service= status=503 bytes=
2013-08-06T06:08:15.570976+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=***** fwd="65.128.39.118" dyno= connect= service= status=503 bytes=

*****代表有意隐藏的信息

解决方法

我不认为这个问题与英雄有关.我在我的一个模型中有一个错误,我有一个类似于属性的类型:type1,type2,我应该将它们分成两行,如belongs_to:type1 belongs_to:type2(很奇怪,耙子没有抛出任何错误在我的地方).

固定后我也碰到另一个问题. Heroku抛出这个错误

Fetching gem Metadata from https://rubygems.org/..
Could not find safe_yaml-0.9.4 in any of the sources

我的Gemfile中没有safe_yaml-0.9.4,但是发现它包含在我的Gemfile.lock中.我将safe_yaml-0.9.4更改为safe_yaml-0.9.3并推送到heroku.一切都恢复正常了

道歉的误导性的标题.但是,如果有人像我一样遇到英雄的错误,这可能会给出解决方案.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


validates:conclusion,:presence=>true,:inclusion=>{:in=>[0,1]}validates:email,:presence=>true,:length=>{:minimum=>3,:maximum=>254},:uniqueness=>true,:email=>truevalidates:ending_order,
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各Master的状态,如果Master异常,则会做主从切换,将Slave作为master,将master做为slave。其配置也较复杂,且表现一般。redis3.0以后已经支持集群容错功能,并且非常简单1.1素材准备centos7(集群搭建,至少三个master。需
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow                 不知道大家是否注意到,全新安装ruby之后,无论是在windows或是linux还是macosX下使用rix
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 modify_my_object!,这个方法名是以!结尾,在ruby的对象里边是用于表达修改本身的意思。比如String#gsub,返回的是一个新的字符串对象;而String#gsub!,返回的是自身已经被修改的对象。不止!这样的特殊字符可以命名,ruby
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表达方式即编程语言,语言是沟通的介质,而编程语言是程序员与计算机沟通的介质。 什么是编程? 编程即程序员根据需求把自己的思想流程按照某种编程语言的语法风格编写下来,产出的结果就是包含一堆字符的文件。二编程语言分
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编程语言的特性包括:数据封装数据抽象多态性继承这些特性将在面向对象的Ruby中进行讨论。一个面向对象的程序,涉及到的类和对象。类是个别对象创建的蓝图。在面向对象的术语中,您
1.ruby的标签<ruby>漢<rp>(<p><rt>han<t><rp>)<p>字<rp>(<p><rt>zi<t><rp>)<p><uby> 
1、软件安装1.安装包是个压缩包-->解压到/homeedis_tar下命令如下: tar-zxvf./../-C/homeedis_tar2.安装c++环境yum-yinstallgcc-c++(注:redis底层源码是c++)3.解压后需要源码编译进入到redis-3.0.0后执行make4.编译完后开始安装需要指定一个安装路径
1.sass基于Ruby语言开发而成,因此安装sass前需要安装Ruby。(注:mac下自带Ruby无需在安装Ruby!)window下安装SASS首先需要安装Ruby,先从官网下载Ruby并安装。安装过程中请注意勾选AddRubyexecutablestoyourPATH添加到系统环境变量。ruby官网:https:/ubyinstaller.org/downloa
本节对我们项目实现的功能和知识点做一个简单的介绍,因为是RESTfulAPI项目,所以对于后端来说基本上没有什么UI界面可展示,那我们就在关键的点,使用客户端(Android)实现的效果图。课程简介这是一门企业级项目实战课程,目的是从0使用Rails开发一个企业级RESTfulAPI项目;他不能让你年薪30