首页 > 解决方案 > 由于 bcrypt,在 Raspberry Pi 2 B 上为 Rails 安装设计 gem 失败

问题描述

我正在尝试通过bundle install. 在我的计算机上可以运行,而当我在 Raspberry Pi 2 Model B 上执行此操作时,设计依赖的bcrypt版本上的 gem3.1.13尝试为 x86 编译自身,而 Raspberry Pi 在 arm 上运行,这意味着构建失败并出现以下错误消息:

Fetching bcrypt 3.1.13
Installing bcrypt 3.1.13 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.7.0/gems/bcrypt-3.1.13/ext/mri
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.7.0 -r ./siteconf20200202-4603-1rqfk3s.rb extconf.rb
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.7.0/gems/bcrypt-3.1.13/ext/mri
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.7.0/gems/bcrypt-3.1.13/ext/mri
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt_blowfish.c

// ===========================
// here's the interesting part
// ===========================
gcc  -D__SKIP_GNU  -D_FILE_OFFSET_BITS=64   -c -o x86.o x86.S
x86.S: Assembler messages:
x86.S:202: Error: junk at end of line, first unrecognized character is `,'
make: *** [<builtin>: x86.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/lib/ruby/gems/2.7.0/gems/bcrypt-3.1.13 for 
inspection.
Results logged to /usr/local/lib/ruby/gems/2.7.0/extensions/armv7l-linux-eabihf/2.7.0 static/bcrypt-3.1.13/gem_make.out

An error occurred while installing bcrypt (3.1.13), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.13' --source 'https://rubygems.org/'` succeedsm before bundling.

In Gemfile:
  devise-two-factor was resolved to 3.0.3, which depends on
    devise was resolved to 4.6.2, which depends on
      bcrypt

当我手动安装 3.1.12 版时,它可以工作。它仅不适用于 3.1.13。有没有办法为正确的架构手动构建它并让捆绑器使用它,或者任何其他方法来解决这个问题?

标签: ruby-on-railsrubydeviseraspberry-pibundler

解决方案


推荐阅读