Kli*_*ian 56 ruby macos osx-lion
我正在尝试安装Ruby 1.9.3但是遇到了问题.我安装了RVM,然后键入:
rvm install 1.9.3
Run Code Online (Sandbox Code Playgroud)
输出说:
ERROR: Error running ' ./configure....
Run Code Online (Sandbox Code Playgroud)
日志说:
configure: WARNING: unrecognized options: --with-libyaml-dir
checking build system type... x86_64-apple-darwin11.2.0
checking host system type... x86_64-apple-darwin11.2.0
checking target system type...x86_64-apple-darwin11.2.0
checking whether the C compiler works... no
configure: error: in `/Users/myuser/.rvm/src/ruby-1.9.3-p0':
configure: error: C compiler cannot create executables See `config.log' for more details
Run Code Online (Sandbox Code Playgroud)
我从App Store下载了新的XCode并安装了它.
zza*_*man 118
尝试使用clang编译器而不是默认值:
rvm install 1.9.3 --with-gcc=clang
Run Code Online (Sandbox Code Playgroud)
Mar*_*c M 15
RVM需要gcc-4.2才能安装ruby 1.9.3.不幸的是,Lion不再包含gcc-4-2,只是llvm版本:
lrwxr-xr-x 1 root wheel 12 15 feb 17:21 /usr/bin/gcc -> llvm-gcc-4.2
Run Code Online (Sandbox Code Playgroud)
如果您有Lion但从Snow Leopard升级,那么您可能仍然拥有gcc-4.2如果您有一个全新的Lion安装,您应该下载gcc-4.2.我建议下载这个包.
https://github.com/kennethreitz/osx-gcc-installer
Run Code Online (Sandbox Code Playgroud)
检查您现在是否安装了gcc-4.2:
-rwxr-xr-x 1 root wheel 113024 16 may 2011 /usr/bin/gcc-4.2
lrwxr-xr-x 1 root wheel 12 15 feb 17:21 /usr/bin/gcc -> llvm-gcc-4.2
Run Code Online (Sandbox Code Playgroud)
现在你可以像往常一样安装ruby 1.9.3:
rvm install 1.9.3
rvm use 1.9.3 --default
Run Code Online (Sandbox Code Playgroud)
jup*_*p0r 13
如果您只想安装并保持最新版本的Ruby(而不是在不同版本的ruby之间切换),您可以通过自制软件安装ruby :
brew install ruby
Run Code Online (Sandbox Code Playgroud)
先试试这个:
rvm get latest
Run Code Online (Sandbox Code Playgroud)
这就是我的工作:
rvm:
version: "rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"
ruby:
interpreter: "ruby"
version: "1.9.3p0"
date: "2011-10-30"
platform: "x86_64-darwin11.2.0"
patchlevel: "2011-10-30 revision 33570"
full_version: "ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]"
Run Code Online (Sandbox Code Playgroud)
实际上,ruby-1.9.3-p125现在可以使用了gcc-llvm.但是,目前的稳定/最新版本rvm还没有(还).但这只是rvm谨慎,现在已经解决了主分支中的解决方法rvm.
只需升级rvm到主分支并安装/升级ruby:
GT-MBP:~ gthiruva$ rvm upgrade ruby-1.9.3-p0 1.9.3
Are you sure you wish to upgrade from ruby-1.9.3-p0 to ruby-1.9.3-p125? (Y/n): Y
Installing new ruby ruby-1.9.3-p125
Fetching yaml-0.1.4.tar.gz to /Users/gthiruva/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/gthiruva/.rvm/src
Configuring yaml in /Users/gthiruva/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/gthiruva/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/gthiruva/.rvm/usr
The autodetected CC(/usr/bin/gcc-4.2) is LLVM based, it is not yet fully supported by
ruby and gems, please read `rvm requirements`, and set CC=/path/to/gcc .
Unable to install ruby ruby-1.9.3-p125. Please install it manually to continue.
GT-MBP:~ gthiruva$ rvm get head
Original installed RVM version:
rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis
<mpapis@gmail.com>`enter code here` [https://rvm.beginrescueend.com/]
...
RVM reloaded!
GT-MBP:~ gthiruva$ rvm reload
RVM reloaded!
GT-MBP:~ gthiruva$ exec bash
rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com>
[https://rvm.beginrescueend.com/]
GT-MBP:~ gthiruva$ rvm upgrade ruby-1.9.3-p0 1.9.3
Are you sure you wish to upgrade from ruby-1.9.3-p0 to ruby-1.9.3-p125? (Y/n): Y
Installing new ruby ruby-1.9.3-p125
...
Successfully migrated ruby-1.9.3-p0 to ruby-1.9.3-p125
Upgrade complete!
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
51365 次 |
| 最近记录: |