Mavericks,RBENV,您的Ruby版本是2.0.0,但是您的Gemfile指定了2.1.1 [英] Mavericks, RBENV, Your Ruby version is 2.0.0, but your Gemfile specified 2.1.1
问题描述
我已阅读并尝试了其他,像我的(都带有可接受的答案)以及几个小时的Google搜索,但没有任何效果.这使我认为我的问题是计算机上的某个Ruby/RBENV生态系统损坏了,或者是一个可怕的PATH问题.我总是必须运行sudo
来安装任何gem,这是我以前从未做过的,所以这也令人困惑.
I've read and tried the suggestions in several, other, questions, like mine (all with accepted answers) as well as a few more hours of Google searching, but nothing worked. That leads me to think my issue is something corrupt with a piece of Ruby/RBENV ecosystem on my computer or maybe a dreaded PATH issue. I always have to run sudo
to install any gems, which I've never had to do before, so that's puzzling too.
这是文件&的一些输出我认为相关的命令.如果您需要更多信息,请告诉我
Here are some outputs of files & commands I think are relevant. If you need more information, please let me know:
.zshrc
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" if which rbenv > /dev/null;
then eval "$(rbenv init - zsh)"; fi
红宝石-v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
rbenv本地
2.1.1
Gemfile(我也炸掉了我的gemfile.lock几次)
Gemfile (I've also blown out my gemfile.lock several times too)
source 'https://rubygems.org'
ruby '2.1.1'
gem 'rails', '4.1.4'
... [omitted for brevity]
.ruby版本
2.1.1
回显$ PATH
/[user path]/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
如果不对我的计算机重新格式化,如果有人对下一步应该做什么有任何想法,我将不胜感激.
I'd be grateful if anyone has any ideas about what I should try next, short of reformatting my computer.
根据本·克里格(Ben Kreeger)的意见,尝试从下面的git仓库安装两个选项. type rbenv
正确返回的rbenv是一个shell函数,原始消息不断出现.我重新安装了Mavericks,但我的设置仍然无法正常工作.
EDIT 1: Tried option B installing both of them from their git repos below as per Ben Kreeger. type rbenv
correctly returned rbenv is a shell function and the original message kept appearing. I reinstalled Mavericks and my setup still isn't working.
每当我尝试安装gem时,都会出现Gem::FilePermissionError
消息,说我无权访问Ruby 2.0.0文件夹(作为系统安装).还要和RBENV一起摆弄更多...
EDIT 2: Any time I try to install a gem, I get a Gem::FilePermissionError
saying I don't have access to the Ruby 2.0.0 folder (installed as system). Going to fiddle with RBENV some more...
进行更多调试(以下所有内容)
EDIT 3: More debugging (everything below)
在使用RBENV安装Ruby版本时保持错误,并发现有人提到readline
问题.
Kept erroring when installing Ruby versions with RBENV and found some people mentioning readline
issues.
尝试了以下步骤以修复阅读行: https://github .com/sstephenson/ruby-build/issues/550#issuecomment-40681557 ,并收到一个错误消息,指出我的Xcode命令行工具安装错误.
Tried the following steps to fix readline: https://github.com/sstephenson/ruby-build/issues/550#issuecomment-40681557, and got an error that my Xcode command line tool install was bad.
运行xcode-select --install
重新安装它们.
再次尝试The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
根据 https://coderwall.com/p/n9bnug ,我链接了我的OpenSSL扩展名与https://coderwall.com/p/n9bnug
As per https://coderwall.com/p/n9bnug, I linked my OpenSSL extension with https://coderwall.com/p/n9bnug
重置Ruby版本:rbenv local 2.1.1
rbenv global 2.1.1
和rbenv rehash
Reset versions of Ruby: rbenv local 2.1.1
rbenv global 2.1.1
and rbenv rehash
一切似乎都表明捆绑程序正在尝试使用我的system
Ruby安装(2.0.0-p247),而不是RBENV指定的内容.迷失链接所在的位置.
Everything seems to indicate bundler is trying to use my system
Ruby install (2.0.0-p247) instead of what RBENV is specifying. Baffled where the missing link is.
推荐答案
哇,真哇.
我要做的只是gem install bundler
,然后是rbenv rehash
.一切正常.
All I had to do was gem install bundler
and then rbenv rehash
. Everything worked.
最初的错误消息使我发现RBENV或我的Ruby版本存在问题,而实际上它只是依赖于旧版本的捆绑程序.
The original error message pointed me to a problem with RBENV or my Ruby version when in reality it was just falling back on an old version of bundler.
为什么我没有收到更标准的this needs bundler version [xxxx]...
错误,而不是告诉我我的Ruby版本指定不正确?
Why wouldn't I have received the more standard this needs bundler version [xxxx]...
error instead of telling me my Ruby version is specified incorrectly?
这篇关于Mavericks,RBENV,您的Ruby版本是2.0.0,但是您的Gemfile指定了2.1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!