我正在使用一个使用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发布于 2018-10-19 23:45:44
`bundle update scrypt`scrypt gem刚刚发布了解决这个问题的3.0.6。它不在changelog中,但您可以阅读PR:https://github.com/pbhogan/scrypt/pull/72
发布于 2018-05-05 18:21:12
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
endhttps://stackoverflow.com/questions/50184614
复制相似问题