heroku / cli.rb:30:在'start'中:未定义的方法`error_with_failure'

时间:2012-07-12 04:14:38

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

我正在与ssh键进行摔跤并上传了一个新的,然后我git push heroku master'ed fine,然后它显示我的登陆页面但显示

 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

3 个答案:

答案 0 :(得分:2)

我已经看到类似这样的东西出现了两个宝石和工具带安装的冲突,而Ruby混淆了什么时候加载。如果您想使用工具带,我强烈建议您卸载任何宝石版本,以避免这种情况(此时可能一切都适合您)。您可以通过运行gem uninstall heroku并选择卸载所有版本来执行此操作。如果您仍然遇到问题,请告诉我,我将很乐意继续帮助解决问题。谢谢!

答案 1 :(得分:1)

请更新heroku gem。这可能是您安装的特定版本中的一个问题。

答案 2 :(得分:0)

heroku run rake db:migrate运行相同的问题。 似乎工具带无法找到Heroku::Helpers.error_with_failure助手。

使用

删除heroku toolbelt文件夹

rm -rf /usr/local/heroku

的可执行文件

sudo rm -rf /usr/bin/heroku

然后尝试从here

重新安装工具带

这为我解决了。