[英]Unable to install any ruby version using rvm in Mac catalina 10.15.2
[英]Install any version of ruby with RVM on mavericks
我刚刚升级到osx mavericks,我想安装ruby 2.0,但我得到configure: error: cannot run C compiled programs.
错误。
我用rvm get stable
更新rvm,然后键入rvm install 2.0.0
并得到一个错误,指示我一个日志文件。 日志文件包含:
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin13.0.0
checking host system type... x86_64-apple-darwin13.0.0
checking target system type... x86_64-apple-darwin13.0.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/mattroberts/.rvm/src/ruby-2.0.0-p247':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
所以,我尝试列出我的版本。 它告诉我我有1.9.3-p392
所以我卸载那个并重新安装,看看是否有效 - 同样的错误。
我是否需要重新安装/更新xcode,还是有其他解决方案?
谢谢!
如果您在升级到Mavericks之后尚未升级Xcode,则应该这样做之后,打开命令提示符并键入:
xcode-select --install
这将安装已被OSX更新删除的xcode命令工具。 之后它应该工作正常。
建议的解决方案没有解决我的问题(最新版本的XCode,安装了命令行工具)。 我使用rvm install ruby-1.9.3 --with-gcc=clang
并且有效。
我以为rvm默认使用clang for OSX。 不确定我是否记得那个错误或改变了什么/这不再是最好的事情。 然而它使我的安装工作。
在Edu的评论之后,他引用的github rvm问题页面警告:
@marksands请确定你知道你是什么,ruby 1.9.3用clang编译不是“安全”,它可以段错误,线程相关的问题是可以预料的,考虑重新安装ruby --with-gcc = gcc42或者只是让rvm安装gcc 4.6,只有ruby 2.0.0与clang完全兼容
这个问题指出了小牛队的gcc46问题:
有问题的宝石使用不同的语言 - 不是C / C ++,它使用Objective-C - 所以它不是编译器的错误,你可以构建gcc-4.6并支持Objective-C - 它默认情况下没有完成。
你现在有两个选择,都是从uninstallig gcc-4.6开始,然后是:
•安装apple-gcc42
•使用--enable-objc安装gcc-4.6
这应该是固定的,运行:
rvm get head
rvm remove 1.9.3
rvm install 1.9.3
不要使用额外的标志
最终为我工作的是安装XCode 然后RUNNING Xcode然后尝试重新安装。
运行
rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib' 'CFLAGS=-I/opt/sm/pkg/active/include' 'CPATH=/opt/sm/pkg/active/include')
纠正了我在Mavericks中的编译问题
进入同样的问题(在10.8.5,所有最新)。 Ruby 2.0.0安装正常,但不是1.9.3。 这个解决方案对我有用。
cd进入ruby路径(在config.log中找到),然后发出.configure
(包含所有选项,如config.log中所示)
make
make install
然后:
rvm use 1.9.3 --create
unset SDKROOT
这对我有用。 我希望它也适合你。
我尝试重新安装xcode和xcode开发人员工具。 没工作。 同样的错误。
尝试使用env -i bash —noprofile —norc
运行,以查看您的环境变量是否导致问题进一步调查。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.