前提
Railsで簡単なブログアプリを開発しているのですが、deviseをインストールしてサインアップ画面に移りサインアップをしようとすると、下記のエラーが起きてしまいます。
deviseをインストールをする際に一緒にbcryptもインストールされると思うのですが、何か対策などはありますでしょうか?
実現したいこと
- deviseでログイン機能を実装したい
発生している問題・エラーメッセージ
LoadError in Devise::RegistrationsController#create dlopen(/Users/daiki/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/bcrypt-3.1.17/lib/bcrypt_ext.bundle, 9): no suitable image found. Did find: /Users/daiki/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/bcrypt-3.1.17/lib/bcrypt_ext.bundle: mach-o, but wrong architecture /Users/daiki/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/bcrypt-3.1.17/lib/bcrypt_ext.bundle: stat() failed with errno=25 - /Users/daiki/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/bcrypt-3.1.17/lib/bcrypt_ext.bundle
該当のソースコード
Gemfile
1source "https://rubygems.org" 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby "2.7.5" 5 6# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" 7gem "rails", "~> 7.0.2", ">= 7.0.2.3" 8gem "sprockets-rails" 9gem "mysql2", "~> 0.5" 10gem "puma", "~> 5.0" 11gem "importmap-rails" 12gem "turbo-rails" 13gem "stimulus-rails" 14gem "jbuilder" 15gem "devise" 16 17gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] 18 19# Reduces boot times through caching; required in config/boot.rb 20gem "bootsnap", require: false 21 22# Use Sass to process CSS 23# gem "sassc-rails" 24 25# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] 26# gem "image_processing", "~> 1.2" 27 28group :development, :test do 29 # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem 30 gem "debug", platforms: %i[ mri mingw x64_mingw ] 31end 32 33group :development do 34 # Use console on exceptions pages [https://github.com/rails/web-console] 35 gem "web-console" 36 37 # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] 38 # gem "rack-mini-profiler" 39 40 # Speed up commands on slow machines / big apps [https://github.com/rails/spring] 41 # gem "spring" 42end 43 44group :test do 45 # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] 46 gem "capybara" 47 gem "selenium-webdriver" 48 gem "webdrivers" 49end
試したこと
gem uninstall bcrypt
bundle install
gem install bcrypt --platform=ruby
補足情報(FW/ツールのバージョンなど)
Ruby 2.7.5p203
Rails 7.0.2.3
macOS BigSur 11.4
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/03/31 08:49
退会済みユーザー
2022/03/31 08:54 編集
2022/03/31 10:22