Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
安装Ruby on Mountain Lion时出现问题-Ruby 1.9.3不会';编译_Ruby_Macos_Gcc_Rvm_Osx Mountain Lion - Fatal编程技术网

安装Ruby on Mountain Lion时出现问题-Ruby 1.9.3不会';编译

安装Ruby on Mountain Lion时出现问题-Ruby 1.9.3不会';编译,ruby,macos,gcc,rvm,osx-mountain-lion,Ruby,Macos,Gcc,Rvm,Osx Mountain Lion,我以前看过很多关于这方面的帖子,并且遵循了他们的指示,但是没有任何效果。我将在下面概述我所做的事情,以及我遵循的指示-如果您有任何建议,我将不胜感激 我遵循了以下安装说明: 我已经下载了OSX Mountain Lion的X代码,并安装了gcc编译器: $ gcc --version i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) Copy

我以前看过很多关于这方面的帖子,并且遵循了他们的指示,但是没有任何效果。我将在下面概述我所做的事情,以及我遵循的指示-如果您有任何建议,我将不胜感激

我遵循了以下安装说明:

我已经下载了OSX Mountain Lion的X代码,并安装了gcc编译器:

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
然后我按照指示安装了最新版本的git

$ git --version
git version 1.7.10.2 (Apple Git-33)
同样,通过命令行对rvm执行相同的操作:

$ rvm --version
rvm 1.16.13 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
通过使用备用命令行,我获得了类似的输出,其中包含一些额外的位:

$ rvm install 1.9.3 --with-gcc=clang
-bash: -dumpversion: command not found
-bash: --version: command not found
-bash: --version: command not found
Installing Ruby from source to: /Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286, this may take a while depending on your cpu(s)...
ruby-1.9.3-p286 - #downloading ruby-1.9.3-p286, this may take a while depending on your connection...
ruby-1.9.3-p286 - #extracted to /Users/mondemoo/.rvm/src/ruby-1.9.3-p286 (already extracted)
ruby-1.9.3-p286 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang', please read /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.
-bash: --version: command not found
查看configure.logs,我得到以下信息:

$ rvm install 1.9.3
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p286.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286, this may take a while depending on your cpu(s)...
ruby-1.9.3-p286 - #downloading ruby-1.9.3-p286, this may take a while depending on your connection...
ruby-1.9.3-p286 - #extracted to /Users/mondemoo/.rvm/src/ruby-1.9.3-p286 (already extracted)
ruby-1.9.3-p286 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286', please read /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.
$ less /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
[2012-10-17 07:39:15] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang
checking build system type... x86_64-apple-darwin12.2.0
checking host system type... x86_64-apple-darwin12.2.0
checking target system type... x86_64-apple-darwin12.2.0
checking whether the C compiler works... no
configure: error: in `/Users/mondemoo/.rvm/src/ruby-1.9.3-p286':
configure: error: C compiler cannot create executables
See `config.log' for more details
我现在完全不知道我做错了什么-有人能帮忙吗??似乎c编译器(gcc?)存在问题,我是否正确解释了它?如果是这样,我该如何解决?另外,如何访问上面configure.log中提到的“config.log”


谢谢

这是RailsInstaller OSX 1.0.3-

您需要更改
/etc/rvmrc
以包含以下内容:

umask g+w
export -a rvm_configure_env
rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib' 'CFLAGS=-I/opt/sm/pkg/active/include' 'CPATH=/opt/sm/pkg/active/include')
当二进制ruby可用于2.0.0时,我将准备安装程序的新版本

更新:对于新版本的RVM
1.19+
/etc/rvmrc
应更改为:

umask g+w
export rvm_autolibs_flag=smf

然后运行
rvm get stabel#或:head

不确定我是否用了“正确”的方法,但我只是删除了rvm(rvm内爆),然后重新安装了它(\curl-L | bash-s stable--ruby)它已安装并正在运行最新版本的ruby 1.9.3-p327。没问题。

请使用四个空格缩进设置您的帖子的格式,以用于终端输出。那么配置日志会说什么?请阅读/Users/mondemo/.rvm/log/ruby-1.9.3-p286/configure.log,这是出于礼貌。感谢Ryan刚刚发现如何缩进:-)Half elf&Warren,我刚刚在configure.log文件的内容中添加了。忽略我的上一篇文章,只是看到行继续-现在将尝试。非常感谢!这对我有用。。。还要安装Ruby 2.0.0。所以现在是2013年4月11日,这个问题还没有解决。为什么Rails总是有问题,我一生中搜索错误消息最多的是Rails安装或设置问题我做了一个
more/etc/rvmrc
,但没有这样的文件。这是伟大的更新rvm应该要么修复它,要么告诉你如何修复它,这个问题发生在你的系统上,它不能自动修复远程-你需要采取行动来修复它。。。最重要的是阅读您运行的命令的输出,实际上我也让它再次工作,但是我在构建其他需要本机扩展的东西时仍然遇到其他问题(