0

我正在尝试使用 RVM 安装 Ruby(最终是 Rails)。这是我收到的错误消息:

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --disable-install-doc --prefix=/Users/Mayank/.rvm/rubies/ruby-1.9.3-p374 --with-opt-dir=/Users/Mayank/.rvm/usr --disable-shared', please read /Users/Mayank/.rvm/log/ruby-1.9.3-p374/configure.log
There has been an error while running configure. Halting the installation.

这是configure.log:

[2013-01-31 00:13:22] ./configure
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 for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

我跑了

export CC=/usr/local/bin/gcc-4.2

并验证那里有一个 gcc-4.2。

RVM 总是进入“配置”阶段,然后似乎进入一个循环,bash 和 env 交替显示在终端窗口的顶部。

我尝试重新运行 RailsInstaller,但没有做任何事情。

这一切的开始是因为

heroku db:push

1.9.3 不支持并且 1.9.2 未安装。

我什至不知道如何搜索这样的错误,但我已经尝试了所有对其他人有用的方法。

编辑。我刚刚运行了rvm debug并得到了这个:

ruby-1.9.3-p374:
/Users/Mayank/.rvm/bin/ruby: line 6: /Users/Mayank/.rvm/bin/ruby: Argument list too long
/Users/Mayank/.rvm/bin/ruby: line 6: /Users/Mayank/.rvm/bin/ruby: Undefined error: 0
4

2 回答 2

1

这是 railisinstaller 中的一个错误,更新 RVMrvm get head并阅读输出,更多细节在这里:https ://stackoverflow.com/a/14078475/497756

于 2013-01-31T16:01:00.893 回答
0

下面的代码有效!

Minis-MacBook-Air:website daraotsu$ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
Minis-MacBook-Air:website daraotsu$ rvm use 2.1.1
Using /Users/daraotsu/.rvm/gems/ruby-2.1.1
Minis-MacBook-Air:website daraotsu$ rails s
于 2014-04-24T12:49:35.810 回答