gpt4 book ai didi

ruby - 当我通过 RVM 在 OSX Lion 上安装 Ruby 1.9.3 时如何修复 make 错误?

转载 作者:数据小太阳 更新时间:2023-10-29 08:10:00 26 4
gpt4 key购买 nike

我一直在尝试在 OSX Lion 上安装 Ruby 1.9.3,但一直遇到 make 错误

Kerrie-Yees-MacBook-Pro:~ kerrieyee$ rvm install 1.9.3 Installing Ruby from source to: /Users/kerrieyee/.rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...

ruby-1.9.3-p194 - #fetching

ruby-1.9.3-p194 - #extracted to /Users/kerrieyee/.rvm/src/ruby-1.9.3-p194 (already extracted)

ruby-1.9.3-p194 - #configuring

ruby-1.9.3-p194 - #compiling

Error running 'make ', please read /Users/kerrieyee/.rvm/log/ruby-1.9.3-p194/make.log There has been an error while running make. Halting the installation.

我已经使用命令行工具安装了 git 1.7.7.5、osx-gcc4.2、homebrew 0.9 和 XCode 4.3。我已经尝试安装 readline 但仍然出现 make 错误。我也是 ruby​​ 的新手,对终端了解不多,所以如果需要更多信息,请同时编写获取信息所需的终端命令。谢谢!

按照提示,我打开了make.log文件

看起来像错误部分的部分是这样的

readline.c:在函数“username_completion_proc_call”中:
readline.c:1499: error: ‘username_completion_function’ undeclared (首次在此函数中使用)
readline.c:1499: error: (每个未声明的标识符只报告一次
readline.c:1499: 错误:对于它出现的每个函数。)
make[2]: *** [readline.o] 错误 1
make[1]: *** [ext/readline/all] 错误 2
make: *** [build-ext] 错误 2

注意到错误与 readline 有关,我查找了有关 readline 的其他问题并遵循了 RVM Instructions。

我输入了 rvm pkg install readlinervm reinstall 1.9.3 --with-readline-dir=$rvm_path/usr

还是有错误:

运行“make”时出错,请阅读/Users/kerrieyee/.rvm/log/ruby-1.9.3-p194/make.log
运行 make 时出现错误。停止安装。

make.log 文件内容如下:

ld:在/usr/local/lib/libxml2.2.dylib 中,文件是为不受支持的文件格式构建的,该文件格式不是架构 x86_64 的链接架构 (x86_64)
collect2: ld 返回 1 退出状态
make[2]: *** [../../.ext/x86_64-darwin11.4.0/tcltklib.bundle] 错误 1
make[1]: *** [ext/tk/all] 错误 2
make: *** [build-ext] 错误 2

我还跑了 brew doctor:

Kerrie-Yees-MacBook-Pro:~ kerrieyee$ brew doctor

Error: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.

Unexpected dylibs: /usr/local/lib/libexslt.0.dylib /usr/local/lib/libexslt.dylib /usr/local/lib/libhistory.6.0.dylib /usr/local/lib/libhistory.6.dylib /usr/local/lib/libhistory.dylib /usr/local/lib/libreadline.6.0.dylib /usr/local/lib/libreadline.6.dylib /usr/local/lib/libreadline.dylib /usr/local/lib/libruby.1.8.7.dylib /usr/local/lib/libruby.1.8.dylib /usr/local/lib/libruby.dylib /usr/local/lib/libsqlite3.0.8.6.dylib /usr/local/lib/libsqlite3.0.dylib /usr/local/lib/libsqlite3.dylib /usr/local/lib/libxml2.2.dylib /usr/local/lib/libxml2.dylib /usr/local/lib/libxslt.1.dylib /usr/local/lib/libxslt.dylib

Error: Unbrewed .la files were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.

Unexpected .la files: /usr/local/lib/libexslt.la /usr/local/lib/libsqlite3.la /usr/local/lib/libxml2.la /usr/local/lib/libxslt.la

Error: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.

Unexpected .pc files: /usr/local/lib/pkgconfig/libexslt.pc /usr/local/lib/pkgconfig/libxml-2.0.pc /usr/local/lib/pkgconfig/libxslt.pc /usr/local/lib/pkgconfig/sqlite3.pc

Error: Unbrewed static libraries were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.

Unexpected static libraries: /usr/local/lib/libexslt.a /usr/local/lib/libhistory.a /usr/local/lib/libreadline.a /usr/local/lib/libruby-static.a /usr/local/lib/libsqlite3.a /usr/local/lib/libxml2.a /usr/local/lib/libxslt.a

最佳答案

我遇到了同样的问题,我通过运行以下命令解决了这个问题:

brew update

brew tap homebrew/dupes

brew install apple-gcc42

curl -L https://get.rvm.io | bash -s stable --ruby

关于ruby - 当我通过 RVM 在 OSX Lion 上安装 Ruby 1.9.3 时如何修复 make 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10965518/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com