【问题标题】:scrypt unable to install via authologicscrypt 无法通过 authologic 安装
【发布时间】:2018-05-05 00:34:34
【问题描述】:

我正在使用一个使用 authlogic 的 Rails 应用程序。包括 scrypt 加密算法(尽管未使用)。我在我的 Mac 上遇到了这个错误。我该如何解决?

为什么 i386 被认为是平台?我真的不在乎 scrypt - 我该如何解决这个问题?

ld: in '/usr/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libunwind.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
rake aborted!
Command failed with status (1): [gcc -bundle -o x86_64-darwin/libscrypt_ext...]
/Users/jt/.rvm/gems/ruby-2.1.2@global/gems/ffi-compiler-1.0.1/lib/ffi-compiler/compile_task.rb:153:in `block in define_task!'
Tasks: TOP => default => x86_64-darwin/libscrypt_ext.bundle
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in /Users/jt/.rvm/gems/ruby-2.1.2@ssui/gems/scrypt-3.0.5 for inspection.
Results logged to /Users/jt/.rvm/gems/ruby-2.1.2@ssui/extensions/x86_64-darwin-17/2.1.0/scrypt-3.0.5/gem_make.out

An error occurred while installing scrypt (3.0.5), and Bundler cannot continue.
Make sure that `gem install scrypt -v '3.0.5'` succeeds before bundling.

In Gemfile:
  authlogic was resolved to 3.6.0, which depends on
    scrypt

【问题讨论】:

  • 我想你已经看过this
  • 我不知道这是一个可怕的错误。

标签: ruby-on-rails authlogic


【解决方案1】:
`bundle update scrypt`

scrypt gem 刚刚发布的 3.0.6 解决了这个问题。它不在更新日志中,但您可以阅读 PR:https://github.com/pbhogan/scrypt/pull/72

【讨论】:

    【解决方案2】:

    scrypt gem 版本3.0.5 导致问题。

    我正在检查他们的releases,但找不到3.0.5。 最新版本是3.0.3

    jvillian 可能是对的。解决方案可能是使用wtfiwtz 建议:

    /Users/<username>/.rvm/gems/ruby-2.3.1/gems/scrypt-2.0.2/ext/scrypt/Rakefile/Users/<username>/.rvm/gems/ruby-2.3.1/gems/scrypt-2.0.2/Rakefile 中删除对-arch i386 的引用,然后执行以下操作:

    cp -R /Users/<username>/.rvm/gems/ruby-2.3.1/gems/scrypt-2.0.2/ ~/Code/scrypt
    cd ~/Code/scrypt
    gem build scrypt.gemspec
    gem install --local scrypt-2.0.2.gem
    

    我还必须在scrypt.gemspec 中注释掉关于签名密钥的一行

    通过检查the scrypt Rakefile sourcecode,我找到了可能触发错误的代码。这是一个特定于 mac 的问题 (if t.platform.mac?)。

    desc "FFI compiler"
    namespace "ffi-compiler" do
      FFI::Compiler::CompileTask.new('ext/scrypt/scrypt_ext') do |t|
        t.cflags << "-Wall -std=c99"
        t.cflags << "-msse -msse2" if t.platform.arch.include? "86"
        t.cflags << "-D_GNU_SOURCE=1" if RbConfig::CONFIG["host_os"].downcase =~ /mingw/
        t.cflags << "-D_POSIX_C_SOURCE=199309L" if RbConfig::CONFIG['host_os'].downcase =~ /linux/
        t.cflags << "-arch x86_64 -arch i386" if t.platform.mac?
        t.ldflags << "-arch x86_64 -arch i386" if t.platform.mac?
    
        t.add_define 'WINDOWS_OS' if FFI::Platform.windows?
      end
    end
    

    【讨论】:

      猜你喜欢
      • 2019-05-27
      • 2019-10-01
      • 2020-02-22
      • 2016-10-14
      • 2020-08-21
      • 2023-01-30
      • 2016-05-18
      • 2021-04-21
      • 2016-05-11
      相关资源
      最近更新 更多