Mac 11.2.3
has_secure_passwordを使いたく
gem 'bcrypt', '~> 3.1.7'のコメントアウトを外してbundle install ⇨rails sをすると以下のエラーが表示されてしまいます。
ご教授頂けると幸いです。
Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': dlopen(/Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bcrypt-3.1.16/lib/bcrypt_ext.bundle, 9): no suitable image found. Did find: (LoadError) /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bcrypt-3.1.16/lib/bcrypt_ext.bundle: mach-o, but wrong architecture /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bcrypt-3.1.16/lib/bcrypt_ext.bundle: mach-o, but wrong architecture - /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bcrypt-3.1.16/lib/bcrypt_ext.bundle from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `block in require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:299:in `load_dependency' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bcrypt-3.1.16/lib/bcrypt.rb:12:in `<main>' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' from /Users/takedanaoya/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:66:in `block (2 levels) in require' from /Users/takedanaoya/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:61:in `each' from /Users/takedanaoya/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:61:in `block in require' from /Users/takedanaoya/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:50:in `each' from /Users/takedanaoya/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:50:in `require' from /Users/takedanaoya/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.14/lib/bundler.rb:173:in `require' from /Users/takedanaoya/twitter/micropost/config/application.rb:20:in `<main>' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `block in require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:299:in `load_dependency' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/server/server_command.rb:138:in `block in perform' from <internal:kernel>:90:in `tap' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/server/server_command.rb:135:in `perform' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/command/base.rb:69:in `perform' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/command.rb:50:in `invoke' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands.rb:18:in `<main>' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' from /Users/takedanaoya/twitter/micropost/bin/rails:5:in `<top (required)>' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load' from /Users/takedanaoya/twitter/micropost/vendor/bundle/ruby/3.0.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>' from <internal:/Users/takedanaoya/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from <internal:/Users/takedanaoya/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from /Users/takedanaoya/twitter/micropost/bin/spring:10:in `block in <top (required)>' from <internal:kernel>:90:in `tap' from /Users/takedanaoya/twitter/micropost/bin/spring:7:in `<top (required)>' from bin/rails:2:in `load' from bin/rails:2:in `<main>' takedanaoya@takedanaoyanoMacBook-Air
#試したこと
1,gem uninstall bcrypt
2,gem uninstall bcrypt-ruby
3,gem install bcrypt --platform=ruby
そしてbundle install
をしてみても同じエラーが表示されてしまう状況です。
また、gem 'bcrypt-ruby', '3.1.1.rc1', :require => 'bcrypt'
と記述してみてたり
bcrtpyのバージョンを16
にしてみてもダメでした。
参考にしたサイト
https://qiita.com/KTakata/items/2e67f7fd73cd4844909e
. . . . gem 'bcrypt', '~> 3.1.7' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.4.4', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do gem 'web-console', '>= 4.1.0' # Display performance information such as SQL time and flame graphs for each request in your browser. gem 'listen', '~> 3.3' gem 'spring' end gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'kaminari'
回答1件
あなたの回答
tips
プレビュー