【问题标题】:wrong number of arguments (0 for 1) (ArgumentError) when git push heroku mastergit push heroku master 时的参数数量错误(0 表示 1)(ArgumentError)
【发布时间】:2016-08-18 06:59:41
【问题描述】:

背景:尝试将狂欢推向heroku。它在 localhost:3000 中工作正常,但在 heroku 中没有运气。

push heroku master 后,没有错误。但是打开heroku时会显示应用程序错误。

任何人都可以帮助摆脱“错误数量的参数”

heroku 打开时

Application Error

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

在heroku日志中,超时如下

Starting process with command `bundle exec unicorn -p 56138 -c ./config/unicorn.rb`
2016-08-18T05:52:21.426098+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/unicorn- 5.1.0/lib/unicorn/configurator.rb:196:in `timeout': wrong number of arguments (0 for 1) (ArgumentError)

【问题讨论】:

    标签: ruby-on-rails heroku spree unicorn


    【解决方案1】:

    在此处关注某人的博客代码时发生错误

    worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
    timeout
    timeout 15
    preload_app true
    before_fork do |server, worker|
    Signal.trap 'TERM' do
      puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
      Process.kill 'QUIT', Process.pid
    end
    defined?(ActiveRecord::Base) and
      ActiveRecord::Base.connection.disconnect!
    end
    after_fork do |server, worker|
    Signal.trap 'TERM' do
      puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
    end
    defined?(ActiveRecord::Base) and
      ActiveRecord::Base.establish_connection
    end
    

    第二行有错误

    timeout
    

    删除了超时然后它起作用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-05
      • 1970-01-01
      • 1970-01-01
      • 2013-02-03
      • 2016-12-26
      • 1970-01-01
      • 1970-01-01
      • 2012-02-07
      相关资源
      最近更新 更多