Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 未初始化常量超时::Heroku处出错_Ruby_Heroku_Sinatra - Fatal编程技术网

Ruby 未初始化常量超时::Heroku处出错

Ruby 未初始化常量超时::Heroku处出错,ruby,heroku,sinatra,Ruby,Heroku,Sinatra,这是我在Heroku日志中看到的: heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 44765` app[web.1]: bundler: failed to load command: rackup (/app/vendor/bundle/ruby/2.3.0/bin/rackup) app[web.1]: NameError: uninitialized constant Timeou

这是我在Heroku日志中看到的:

heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 44765`
app[web.1]: bundler: failed to load command: rackup (/app/vendor/bundle/ruby/2.3.0/bin/rackup)
app[web.1]: NameError: uninitialized constant Timeout::Error
app[web.1]: Did you mean?  KeyError
app[web.1]:                IOError
app[web.1]:                Errno
app[web.1]:   /app/vendor/ruby-2.3.3/lib/ruby/2.3.0/resolv.rb:164:in `<class:Resolv>'
app[web.1]:   /app/vendor/ruby-2.3.3/lib/ruby/2.3.0/resolv.rb:39:in `<top (required)>'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in `require'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in `require_with_backports'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/twitter-6.1.0/lib/twitter/streaming/connection.rb:3:in `<top (required)>'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in `require'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in `require_with_backports'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/twitter-6.1.0/lib/twitter/streaming/client.rb:5:in `<top (required)>'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in `require'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in `require_with_backports'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/twitter-6.1.0/lib/twitter.rb:26:in `<top (required)>'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in `require'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in `require_with_backports'
app[web.1]:   /app/sixnines.rb:34:in `<top (required)>'
app[web.1]:   /app/config.ru:23:in `require_relative'
app[web.1]:   /app/config.ru:23:in `block in <main>'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:55:in `instance_eval'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:55:in `initialize'
app[web.1]:   /app/config.ru:in `new'
app[web.1]:   /app/config.ru:in `<main>'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:49:in `eval'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:49:in `new_from_string'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:40:in `parse_file'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:300:in `build_app_and_options_from_config'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:209:in `app'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:337:in `wrapped_app'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:273:in `start'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:148:in `start'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/bin/rackup:4:in `<top (required)>'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/bin/rackup:22:in `load'
app[web.1]:   /app/vendor/bundle/ruby/2.3.0/bin/rackup:22:in `<top (required)>'
heroku[web.1]: Process exited with status 1
heroku[web.1]:使用命令'bundle exec rackup config.ru-p 44765启动进程`
app[web.1]:bundler:未能加载命令:rackup(/app/vendor/bundle/ruby/2.3.0/bin/rackup)
应用程序[web.1]:名称错误:未初始化的常量超时::错误
应用程序[web.1]:你的意思是?关键错误
应用程序[web.1]:IOError
应用程序[web.1]:错误号
app[web.1]:/app/vendor/ruby-2.3.3/lib/ruby/2.3.0/resolv.rb:164:in`'
app[web.1]:/app/vendor/ruby-2.3.3/lib/ruby/2.3.0/resolv.rb:39:in`'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in'require'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in'require_with_backports'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/twitter-6.1.0/lib/twitter/streaming/connection.rb:3:in`'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in'require'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in'require_with_backports'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/twitter-6.1.0/lib/twitter/streaming/client.rb:5:in`'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in'require'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in'require_with_backports'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/twitter-6.1.0/lib/twitter.rb:26:in`'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in'require'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/backports-3.8.0/lib/backports/std_lib.rb:9:in'require_with_backports'
app[web.1]:/app/sixnines.rb:34:in`'
app[web.1]:/app/config.ru:23:in'require\u relative'
app[web.1]:/app/config.ru:23:in'block in'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:55:in'instance_eval'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:55:in'initialize'
app[web.1]:/app/config.ru:in'new'
app[web.1]:/app/config.ru:in`'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:49:in'eval'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:49:in'new_from_string'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/builder.rb:40:in'parse_file'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:300:'build_app_和_options_from_config'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:209:in'app'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:337:in'wrapped_app'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:273:in'start'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/server.rb:148:in'start'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/bin/rackup:4:in`'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/bin/rackup:22:in'load'
app[web.1]:/app/vendor/bundle/ruby/2.3.0/bin/rackup:22:in`'
heroku[web.1]:进程已退出,状态为1
我尝试了所有方法,但无法真正理解为什么找不到
timeout
。有什么提示吗?这是来源:

最初,gem名称是。由于未知的原因,RubyGems也允许发布它

因此,当作为
timeout
包含在
Gemfile
中时,它会阻止Ruby的本机
timeout
模块,该模块定义
timeout::Error

所以,
Gemfile
中的行应该是

gem 'timeout-extensions'
而不是

gem 'timeout'

有没有可能是
timeout
gem破坏了定义了
timeout::Error
的Ruby的
timeout
模块?@PavelMikhailyuk我怀疑这正是发生的事情。你知道怎么解决吗?试着把gem'timeout'改成gem'timeout extensions'。不会有帮助的-扔掉它。你不需要有9颗星的0.0.1宝石,卢克:)@PavelMikhailyuk就是这样,用
超时扩展取代了它,问题就消失了。谢谢请随意发布答案,我会接受的。