【问题标题】:gcc-4.6 Error with installing ruby gem scryptgcc-4.6 安装 ruby​​ gem scrypt 时出错
【发布时间】:2014-12-26 20:38:07
【问题描述】:

我正在尝试安装 scrypt gem 并继续运行错误,如下所示。

Fetching: ffi-1.9.6.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.6
Fetching: ffi-compiler-0.1.3.gem (100%)
Successfully installed ffi-compiler-0.1.3
Fetching: scrypt-2.0.0.gem (100%)
ERROR:  Error installing scrypt:
    ERROR: Failed to build gem native extension.

Building native extensions.  This could take a while...
    /Users/CHENGLC/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -rubygems /Users/CHENGLC/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake RUBYARCHDIR=/Users/CHENGLC/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-13/1.9.1/scrypt-2.0.0 RUBYLIBDIR=/Users/CHENGLC/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-13/1.9.1/scrypt-2.0.0
mkdir -p x86_64-darwin

/usr/local/opt/gcc46/bin/gcc-4.6 -fexceptions -O -fno-omit-frame-pointer -fno-strict-aliasing -Wall -msse -msse2 -arch x86_64 -arch i386  -o x86_64-darwin/crypto_scrypt-sse.o -c ./crypto_scrypt-sse.c


gcc-4.6: error: x86_64: No such file or directory
gcc-4.6: error: i386: No such file or directory
gcc-4.6: error: unrecognized option '-arch'
gcc-4.6: error: unrecognized option '-arch'

rake aborted!
Command failed with status (1): [/usr/local/opt/gcc46/bin/gcc-4.6 -fexcepti...]

Tasks: TOP => default => x86_64-darwin/libscrypt_ext.bundle => x86_64-darwin/crypto_scrypt-sse.o
(See full trace by running task with --trace)

rake failed, exit code 1

我尝试重新安装 ruby​​,重置 rvm 并重新安装 gcc,但这些都没有帮助。请让我知道是否有办法解决这个问题。以下是环境:

ruby -v 
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin13.4.0]

rvm -v 
rvm 1.26.6 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

除此之外,我想知道是否有我可以学习的材料来设置环境,例如:.bashrc 文件中的每一行是什么意思?

提前致谢。

【问题讨论】:

  • @fvu 嗨,我已经安装了命令行工具,但仍然遇到问题。
  • 您可能想尝试从组合中消除 RVM,方法是尝试 ruby-install

标签: ruby gcc


【解决方案1】:

在 CLI 中尝试这些步骤

brew tap homebrew/versions && brew install apple-gcc42

brew link --force apple-gcc42

ln -nsf $(which gcc-4.2) /usr/bin/gcc-4.2

然后尝试安装您的 gem。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-24
    • 1970-01-01
    相关资源
    最近更新 更多