繁体   English   中英

OS X Mavericks打破了rbenv?

[英]OS X Mavericks broke rbenv?

最近,我安装了OS X Mavericks,它似乎搞砸了我的开发环境。 运行'rails new first_app'后我收到此消息:

Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:

    bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.

Password: 
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.9.0)
Using atomic (1.1.15)
Using thread_safe (0.2.0)

Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/build_info/tzinfo-0.3.39.info
An error occurred while installing tzinfo (0.3.39), and Bundler cannot continue.
Make sure that `gem install tzinfo -v '0.3.39'` succeeds before bundling.

然后我做了我的要求:

christohersmbp2:hartl christopherspears$ gem install tzinfo -v '0.3.39'
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

有点奇怪的是我确实安装了rbenv。 事实上,在尝试调试此问题时,我升级了rbenv:

christohersmbp2:~ christopherspears$ brew update
Already up-to-date.
christohersmbp2:~ christopherspears$ brew upgrade rbenv ruby-build
Warning: A newer Command Line Tools release is available
Update them from Software Update in the App Store.
Error: rbenv-0.4.0 already installed
Error: ruby-build-20140225 already installed

但是,当我尝试从命令行调用rbenv时,我收到此错误消息:

christohersmbp2:hartl christopherspears$ rbenv
-bash: rbenv: command not found
christohersmbp2:~ christopherspears$ rbenv rehash
-bash: rbenv: command not found

我想我已经正确设置了路径:

christohersmbp2:hartl christopherspears$ echo $PATH
/usr/local/share/python:/Users/christopherspears/.rbenv/bin:/Users/christopherspears/bin:/usr/local/heroku/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

这是我在.bash_profile文件中的内容:

# rbenv stuff
export PATH="$HOME/.rbenv/bin:$PATH"
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

奇怪的是,我确实认为我在我的版本文件夹中使用了Ruby版本:

christohersmbp2:versions christopherspears$ pwd
/Users/christopherspears/.rbenv/versions
christohersmbp2:versions christopherspears$ ls
2.0.0-p247/
christohersmbp2:versions christopherspears$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

任何提示? 我似乎正在做正确的事情。

更新:

我下载并安装了Xcode命令行工具。 似乎没有工作:

christohersmbp2:~christopherspears $ rbenv -bash:rbenv:命令未找到

正如@Christoper Spears所说,卸载然后重新安装,或者更具体地说:

$ brew uninstall rbenv
$ brew install rbenv

(假设您首先使用brew来安装它)。

嗯......秘密显然是卸载然后重新安装rbenv。 实际上,卸载并重新安装OS X Mavericks破坏的开发工具似乎(几乎)始终是解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM