【问题标题】:After upgrading to Mountain Lion don't work Rails app (Heroku + Git)升级到 Mountain Lion 后,Rails 应用程序无法运行(Heroku + Git)
【发布时间】:2012-11-13 10:11:22
【问题描述】:

今天我从 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" - 即使我没有在我的应用程序中使用它,但没有帮助我。还是一样的错误信息。

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

提前谢谢你

【问题讨论】:

  • 如果您输入 which gitwhich heroku 会发生什么?
  • which git => 没有,which heroku => /Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/heroku
  • 你有没有发现无法加载 EventMachine C 扩展的部分?

标签: ruby macos git heroku osx-lion


【解决方案1】:

转到http://mxcl.github.com/homebrew/ 并安装自制软件并运行

$ brew install git

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

$ rvm get stable
$ rvm install 1.9.3

如果您的 rails 和 heroku gem 丢失,您可能还需要重新下载。

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

【讨论】:

  • 谢谢 Oliver,我正在按照您的建议进行尝试。当我运行brew install wget 时,我得到Warning: Xcode is not installed! Builds may fail! Error: No such file or directory - /usr/bin/cc 我无法解决这个问题。
猜你喜欢
  • 2012-08-19
  • 1970-01-01
  • 2014-09-03
  • 2012-08-18
  • 2015-04-12
  • 1970-01-01
  • 2012-07-26
  • 2014-01-31
  • 2012-08-10
相关资源
最近更新 更多