Ruby错误:使用Heroku的工头启动时Gem:Module(NoMethodError)的未定义方法`load_yaml'

时间:2012-10-15 19:05:12

标签: ruby heroku rvm foreman

我开始玩Heroku在他们的免费计划中部署一个简单的Node.js。但是当我运行foreman start时,我看到了这个错误:

/Library/Ruby/Site/1.8/rubygems/builder.rb:10: undefined method `load_yaml' for Gem:Module (NoMethodError)
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1110:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1110
    from /usr/local/foreman/lib/foreman/process.rb:2:in `require'
    from /usr/local/foreman/lib/foreman/process.rb:2
    from /usr/local/foreman/lib/foreman/engine.rb:3:in `require'
    from /usr/local/foreman/lib/foreman/engine.rb:3
    from /usr/local/foreman/lib/foreman/cli.rb:3:in `require'
    from /usr/local/foreman/lib/foreman/cli.rb:3
    from /usr/bin/foreman:13:in `require'
    from /usr/bin/foreman:13

问题:我对Ruby平台几乎一无所知,我不使用。我碰巧在我的机器上安装了rvm,因为我曾经想玩Octopress(基于Jekyll的博客生成器)。我第一次搜索互联网,但找不到任何东西。我还访问了官方的RVM站点并按照故障排除的基本步骤进行了操作:我运行了rvm stable(它没有产生任何输出...),确保对我的~/.bash_profile中的RVM脚本的调用是最后的,并且是的我正在使用bash。

以下是我可以提供的信息,以便您可以帮助我。

我在OS X 10.6.8下。

rvm list打印:

rvm rubies

=> ruby-1.9.2-p290 [ x86_64 ]

which ruby打印:

/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin/ruby

rvm info打印:

ruby-1.9.2-p290:

  system:
    uname:       "Darwin djebbz 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
    bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
    zsh:         "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"

  rvm:
    version:      "rvm 1.8.3 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p290"
    date:         "2011-07-09"
    platform:     "x86_64-darwin10.8.0"
    patchlevel:   "2011-07-09 revision 32553"
    full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]"

  homes:
    gem:          "/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290"
    ruby:         "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290"

  binaries:
    ruby:         "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin/ruby"
    irb:          "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin/irb"
    gem:          "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin/gem"
    rake:         "/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290/bin/rake"

  environment:
    PATH:         "/Users/khalid_jebbari/.gem/ruby/1.8/bin:/usr/local/heroku/bin:/Users/khalid_jebbari/bin/bin:/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290/bin:/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290@global/bin:/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/khalid_jebbari/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin"
    GEM_HOME:     "/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290"
    GEM_PATH:     "/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290:/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290@global"
    MY_RUBY_HOME: "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290"
    IRBRC:        "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

1 个答案:

答案 0 :(得分:1)

PATH未正确设置,我的猜测是你重置或预设路径,使用ruby使其正常工作:

rvm use 1.9.2-p290

并安装工头:

gem install foreman