我正在使用使用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
答案 0 :(得分:3)
`bundle update scrypt`
刚刚发布的scrypt gem 3.0.6解决了此问题。它不在变更日志中,但您可以阅读PR:https://github.com/pbhogan/scrypt/pull/72
答案 1 :(得分:0)
scrypt
gem版本3.0.5
导致问题。
我正在检查他们的releases,但找不到3.0.5
。
最新版本为3.0.3
jvillian
可能是对的。解决方案可能是使用wtfiwtz
建议:
从
-arch i386
和/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
的引用,然后执行以下操作:
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