加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

红宝石 – 设置env,OSX rbenv和捆绑战

发布时间:2020-12-16 20:08:13 所属栏目:百科 来源:网络整理
导读:所以我刚刚从ubuntu交换到mac,设置env并没有像承诺那么容易. 这是我遵循的过程. 安装xcode – 然后进入prerences并下载命令行工具 然后通过运行gcc -version来验证是否安装了正确的版本 i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
所以我刚刚从ubuntu交换到mac,设置env并没有像承诺那么容易.

这是我遵循的过程.

>安装xcode – 然后进入prerences并下载命令行工具
>然后通过运行gcc -version来验证是否安装了正确的版本

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation,Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

>然后安装homebrew $ruby?? -e“$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)”
运行酿造医生,这是我得到的

你的系统已经准备好了.

安装git brew update brew install git

通过ssh将我的电脑连接到我的git帐户

安装Rbenv

$brew update
$brew install rbenv
$brew install ruby-build

将eval“$(rbenv init – )”添加到我的.bash_profile文件中

>运行rbenv install -list查看我可以安装的所有版本,然后运行

$rbenv install 1.9.3-p327
$rbenv global 1.9.3-p327

(我应该rehashed rbenv但我忘了)然后我运行gem安装捆绑包
>然后进入我的一个repo的,并运行捆绑安装,有错误

Gem::InstallError: better_errors requires Ruby version >= 1.9.2.
An error occurred while installing better_errors (0.7.0),and Bundler cannot continue.
Make sure that `gem install better_errors -v '0.7.0'` succeeds before bundling.

跑了ruby -v,看到它是1.8.7“球” – 我惊呼

>补救这个我做了以下rbenv rehash
> ruby?? -v并得到红宝石1.9.3p327(2012-11-10修订版37606)[x86_64-darwin12.3.0]然后高兴自己
>然后尝试运行bundle,同样的错误出现?

$which bundle
/usr/bin/bundle

$which gem
/Users/fortknokx/.rbenv/shims/gem

所以这是现在我站起来困惑的地方.正如我所说,这是我第三天使用mac,我很了解理解$PATH,我相信我在某处犯规.任何建议我开放.

ps这是我在.bash_profile中的

export PATH="/usr/local/bin:/usr/local/bin/sublime:~/bin:$PATH"
eval "$(rbenv init -)"

解决方法

问题似乎是你使用系统ruby安装的bundler,而不是一个rbenv ruby??安装.

运行ruby –version来确保你的rbenv ruby??是活动的,然后运行gem install bundler,然后是rbenv rehash,然后尝试重新安装你的gem,看看是否有效.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读