1

我开始使用 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(它只是没有产生任何输出......),确保对 RVM 脚本的调用在我的最后一个~/.bash_profile,是的,我正在使用 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:       ""
4

1 回答 1

1

PATH设置不正确,我的猜测是你重置或预设 PATH,使用 ruby​​ 使其工作:

rvm use 1.9.2-p290

并安装工头:

gem install foreman
于 2012-10-15T19:25:53.393 回答