0

今天我从 Snow Leopard 升级到 Mountain Lion,当我尝试检查 Heroku 上托管的 Rails 应用程序时, heroku open 我会收到以下错误消息:

 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       No such file or directory -  git --version  (Errno::ENOENT)
    Backtrace:   /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/helpers.rb:105:in ``'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/helpers.rb:105:in `has_git?'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/helpers.rb:110:in `git'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/command/base.rb:206:in `git_remotes'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/command/base.rb:179:in `extract_app_in_dir'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/command/base.rb:31:in `app'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/command/apps.rb:269:in `open'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/command.rb:193:in `run'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/lib/heroku/cli.rb:25:in `start'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.30.4/bin/heroku:16:in `<top (required)>'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/heroku:19:in `load'
                 /Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/heroku:19:in `<main>'

    Command:     heroku open
    Plugins:     heroku-sql-console
    Version:     heroku-gem/2.30.4 (x86_64-darwin10.8.0) ruby/1.9.2

当我尝试检查git时: git status 我会得到:

-bash: git: command not found

发生了什么事?升级到新版OS X移除Git 和 Heroku

编辑:好的,所以关于git解决 Hombrew 安装的问题。但是,当我运行应用程序 - 时rails s,我得到了:

Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require': dlopen(/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-1.0.0/lib/rubyeventmachine.bundle, 9): Library not loaded: /opt/local/lib/libssl.1.0.0.dylib (LoadError)
  Referenced from: /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-1.0.0/lib/rubyeventmachine.bundle
  Reason: image not found - /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-1.0.0/lib/rubyeventmachine.bundle
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-1.0.0/lib/eventmachine.rb:8:in `<top (required)>'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.5.0/lib/thin.rb:7:in `<top (required)>'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
    from /Users/adam/rubydev/future_computers/config/application.rb:7:in `<top (required)>'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands.rb:53:in `require'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap'
    from /Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

我还尝试在声明中添加提到的 gem gem "eventmachine"- 即使我没有在我的应用程序中使用它,但没有帮助我。仍然是相同的错误消息。

谁能帮助我,请,如何解决这个问题?

提前谢谢你

4

1 回答 1

0

转到http://mxcl.github.com/homebrew/并安装 homebrew 并运行

$ brew install git

它似乎git丢失了,你需要它。过渡过程中一定有什么问题——你可能需要再次安装它,并且可能需要 rvm + ruby​​——但是因为它们存储在你的主目录中,所以你应该没问题。以防万一:

$ rvm get stable
$ rvm install 1.9.3

如果您的 rails 和 heroku gem 丢失,您可能还需要再次下载它们。

该错误似乎来自在系统目录中安装 git,并且在您升级时它被覆盖 - 使用自制软件,这样您就安全了,它不会再次发生。

于 2012-11-25T22:50:06.670 回答