【发布时间】:2016-11-04 21:10:21
【问题描述】:
我使用的是 OS X 10.10.5 (Yosemite)。我正在尝试为 MacDown 克隆 github repo。自述文件中的说明说克隆后应该这样做
git submodule init
git submodule update
bundle install
bundle exec pod install
我不是 ruby 程序员,所以我必须安装 Bundler。前两个步骤运行良好,但当我尝试运行 bundle install 时出现错误
activesupport-5.0.0.1 requires ruby version >= 2.2.2, which is incompatible with the current version, ruby 2.0.0p481
所以我尝试了brew install ruby,现在我有了
saul@miniMac ✓ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin14]
但是,bundle install 给了我和以前一样的错误信息。很明显,它是在/usr/bin/ruby 找到红宝石,而不是在/usr/local/bin/ruby 找到红宝石。我该如何纠正这个问题?
我以为问题可能是我在升级 ruby 之前安装了 bundler,sudo gem uninstall bundler 和 sudo gem uninstall bundle 都没有任何效果,我不知道还有什么可以尝试的。
这是所有输出,以防相关:
saul@miniMac ✓ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
activesupport-5.0.0.1 requires ruby version >= 2.2.2, which is incompatible with
the current version, ruby 2.0.0p481
编辑:
感谢您的建议。我再次尝试gem install bundler,但没有帮助。我得到了同样的错误信息。这是我从bundle env得到的信息
saul@miniMac ✗ bundle env
Environment
Bundler 1.13.6
Rubygems 2.0.14
Ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
Git 2.5.4 (Apple Git-61)
Gemfile
source 'https://rubygems.org'
gem 'cocoapods', '0.39.0'
Gemfile.lock
<No /Users/saul/Projects/macdown/Gemfile.lock found>
编辑 2:
saul@miniMac ✓ which -a bundle
/usr/local/bin/bundle
/usr/bin/bundle
【问题讨论】:
-
bundle env显示什么?另外,我会检查你的包文件的头部,看看#!运算符中硬编码的内容。 github.com/bundler/bundler/issues/4260 -
我认为您只需要在 Ruby 上为 homebrew 版本安装 Bundler。
gem install bundler(再次)修复它了吗? -
@gr1zzlybe4r 谢谢,但我不明白如何“检查我的捆绑文件的头部”。我对红宝石一无所知。
-
which -a bundle显示什么? -
@matt 请参见上面的编辑 2。
标签: ruby bash bundler activesupport