ruby-on-rails - Heroku/cli.rb :30:in `start' : undefined method `error_with_failure'

标签 ruby-on-rails deployment heroku web-deployment

我正在与 ssh key 搏斗并上传了一个新 key ,然后我 git push heroku master'ed 很好,然后它显示了我的登陆页面,但显示

 We're sorry, but something went wrong.

我在stackoverflow中发现可能是我还没有运行

 heroku rake db:migrate

(没有标准文档说要这样做!)但是当我运行时,我得到了这个:

 User/<computername>/.heroku/client/lib/heroku/cli.rb:30:in `start': undefined method `error_with_failure' 
 for Heroku::Helpers:Module (NoMethodError)from /usr/bin/heroku:28

该文件的代码如下所示:

def self.start(*args)
begin
  if $stdin.isatty
    $stdin.sync = true
  end
  if $stdout.isatty
    $stdout.sync = true
  end
  command = args.shift.strip rescue "help"
  Heroku::Command.load
  Heroku::Command.run(command, args)
rescue Interrupt
  `stty icanon echo`
  error("Command cancelled.")
rescue => error
if Heroku::Helpers.error_with_failure <<<<<<<<< Line #30 WHERE ERROR OCCURS  
    display("failed")
    Heroku::Helpers.error_with_failure = false
  end
  $stderr.puts(' !    Heroku client internal error.')
  $stderr.puts(" !    Search for help at: https://help.heroku.com")
  $stderr.puts(" !    Or report a bug at: https://github.com/heroku/heroku/issues/new")
  $stderr.puts
  $stderr.puts("    Error:       #{error.message} (#{error.class})")
  $stderr.puts("    Backtrace:   #{error.backtrace.first}")
  error.backtrace[1..-1].each do |line|
    $stderr.puts("                 #{line}")
  end

最佳答案

我见过类似的情况,因为同时安装了 gem 和 toolbelt,而 Ruby 混淆了从何时加载什么内容。如果您想使用 toolbelt,我强烈建议您卸载任何 gem 版本,您可能必须避免这种情况(并且可能一切都应该适合您)。您可以通过运行 gem uninstall heroku 并选择卸载所有版本来完成此操作。如果您仍然遇到问题,请告诉我,我很乐意继续帮助解决问题。谢谢!

关于ruby-on-rails - Heroku/cli.rb :30:in `start' : undefined method `error_with_failure' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11444918/

相关文章:

ruby-on-rails - Rails、Cucumber、Capybara、Selenium、Pow、域、子域和 javascript

ruby-on-rails - 在Ruby on Rails中,要扩展String类,代码应该放在哪里?

ruby-on-rails - 如何将 nginx 配置为代理到 Rails 应用程序?这样我就不必说 domain.com :port

ruby-on-rails - 个人服务器上类似 heroku 的工作流程

mysql - 将一个表的属性内容复制到rails中另一个表的属性

ruby-on-rails - 如何在不使用 RVM 的情况下指定 Ruby for Rails 的版本?

Android 应用显示的版本低于 list

deployment - 暂存环境有规范的定义吗?

java - Heroku 中的 Greenscript

node.js - Reactjs : Unable to push to Heroku