ruby-on-rails - 由于 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。有没有办法为正确的架构手动构建它并让捆绑器使用它,或者任何其他方法来解决这个问题?
解决方案
推荐阅读
- matlab - 'double' 类型的输入参数的未定义函数 'equation'
- python - 取函数矩阵的逆
- swift - Swift、macOS、带有 2 个 GPU 的 mac,矩阵运算在一个 GPU 上工作,而不是在另一个 GPU 上工作
- python-3.x - Numpy __isub__ 改变全局变量
- php - 在 PHP 脚本中使用 exec(convert) 时出现错误“转换:找不到命令”
- sql - regexp_substr 字符串中的数字比率
- android - 在 Chrome OS 中的 Linux beta 上安装 .apk 时出错
- java - 以相同顺序重复数组 x 中的元素
- performance - OpenCL clCreateContextFromType 函数导致内存泄漏
- driver - 可签名性未通过 Windows 驱动程序测试