【发布时间】:2014-04-10 07:34:28
【问题描述】:
我是终端方面的新手(PATH、rvm 和 ruby),在尝试修复 Sass / Compass 时,我不小心卸载了 ruby('rvm reinstall all --force' 失败)。所以我正在尝试重新安装ruby-1.9.3-p374(需要版本),而不需要像上次那样长(2天groan)
一个复杂的问题是我上次安装 ruby,我尝试了 Macports、rvm、rbenv 方法,但我担心我的系统是一团糟。
运行:OSX 10.9.2 Mavericks
我的安装尝试:
$ rvm install ruby-1.9.3-p374 --with-gcc=gcc
Warning! PATH is not properly set up, '/Users/ash/.rvm/gems/ruby-1.9.3-p374/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p374'.
ruby-1.9.3-p374 - #removing src/ruby-1.9.3-p374..
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
Warning: found user selected compiler 'gcc', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/ash/.rvm/rubies/ruby-1.9.3-p374, this may take a while depending on your cpu(s)...
ruby-1.9.3-p374 - #downloading ruby-1.9.3-p374, this may take a while depending on your connection...
ruby-1.9.3-p374 - #extracting ruby-1.9.3-p374 to /Users/ash/.rvm/src/ruby-1.9.3-p374...
ruby-1.9.3-p374 - #applying patch /Users/ash/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p374 - #configuring.................................................
ruby-1.9.3-p374 - #post-configuration.
ruby-1.9.3-p374 - #compiling.....................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/ash/.rvm/log/1397112910_ruby-1.9.3-p374/make.log
f_rational_new_no_reduce1(VALUE klass, VALUE x)
^
6 warnings generated.
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
regparse.c:582:15: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
return t->num_entries;
~~~~~~ ~~~^~~~~~~~~~~
1 error generated.
make: *** [regparse.o] Error 1
++ return 2
There has been an error while running make. Halting the installation.
我也试过
rvm install ruby-1.9.3-p374 --with-gcc=clang 和 rvm install ruby-1.9.3-p374
更多信息
路径
我对 PATH 中应该包含什么以及以什么顺序非常模糊。但是我的 PATH 对任何人来说都是错误的吗?
$ echo $PATH
/usr/local/bin:
/opt/local/bin:
/opt/local/sbin:
/opt/local/bin:
/opt/local/sbin:
/Users/ash/.rvm/gems/ruby-1.9.3-p374/bin:
/Users/ash/.rvm/gems/ruby-1.9.3-p374@global/bin:
/Users/ash/.rvm/rubies/ruby-1.9.3-p374/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:/sbin:
/opt/X11/bin:
/usr/local/git/bin:
/Users/ash/.rvm/bin:
/usr/local/share/npm/bin/
注意:为便于阅读添加了换行符
bashrc
$ nano ~/.bashrc
NANO:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
NODE_PATH="/usr/local/share/npm/lib/node_modules/"
export NODE_PATH
if which ruby >/dev/null && which gem >/dev/null; then
PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH"
fi
export PATH="/usr/local/share/npm/bin:$PATH"
bash_profile
$ nano ~/.bash_profile
NANO:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
eval "$(rbenv init -)"
export CC=gcc
##
# Your previous /Users/ash/.bash_profile file was backed up as /Users/ash/.bash_profile.macports-saved_2013-09-17_at_15:58:10
##
# MacPorts Installer addition on 2013-09-17_at_15:58:10: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM
##
# Your previous /Users/ash/.bash_profile file was backed up as /Users/ash/.bash_profile.macports-saved_2014-01-24_at_11:35:53
##
# MacPorts Installer addition on 2014-01-24_at_11:35:53: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
export PATH=/usr/local/bin:$PATH
export PATH=$PATH:/usr/local/share/npm/bin
Eww...rvm、rbenv 和 Macports 都混在一起...简直不自然
宝石
$ echo $GEMS
空:(
红宝石
$ rvm list
Warning! PATH is not properly set up, '/Users/ashleycoleman/.rvm/gems/ruby-1.9.3-p374/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p374'.
rvm rubies
# No rvm rubies installed yet. Try 'rvm help install'.
:'(
我在运行rvm use ruby-1.9.3-p374 后尝试安装,但没有帮助
酿酒医生
$ brew doctor
Your system is ready to brew.
:'D
【问题讨论】:
标签: ruby