前提・実現したいこと
このサイトのrailsインストールの項目から手順通りにrailsの環境構築をしているのですが以下のエラーが出てしまい全くうまく行きません
今回初めてm1macを使い今までwindowsではこのようなエラーになったことがなかったので大変困っています
発生している問題・エラーメッセージ
% rails -v Traceback (most recent call last): 29: from bin/rails:2:in `<main>' 28: from bin/rails:2:in `load' 27: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/spring:7:in `<top (required)>' 26: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/spring:7:in `tap' 25: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/spring:10:in `block in <top (required)>' 24: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require' 23: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require' 22: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>' 21: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load' 20: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>' 19: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run' 18: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call' 17: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call' 16: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load' 15: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/rails:4:in `<top (required)>' 14: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/rails:4:in `require_relative' 13: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/config/boot.rb:4:in `<top (required)>' 12: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/config/boot.rb:4:in `require' 11: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/setup.rb:2:in `<top (required)>' 10: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/setup.rb:2:in `require_relative' 9: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap.rb:5:in `<top (required)>' 8: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap.rb:5:in `require_relative' 7: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache.rb:61:in `<top (required)>' 6: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache.rb:61:in `require_relative' 5: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache/store.rb:4:in `<top (required)>' 4: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/explicit_require.rb:41:in `with_gems' 3: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache/store.rb:4:in `block in <top (required)>' 2: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache/store.rb:4:in `require' 1: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `<top (required)>' /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `require': dlopen(/Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle, 9): no suitable image found. Did find: (LoadError) /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle: mach-o, but wrong architecture /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle: mach-o, but wrong architecture - /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle 30: from bin/rails:2:in `<main>' 29: from bin/rails:2:in `load' 28: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/spring:7:in `<top (required)>' 27: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/spring:7:in `tap' 26: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/spring:10:in `block in <top (required)>' 25: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require' 24: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require' 23: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>' 22: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load' 21: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>' 20: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run' 19: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call' 18: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call' 17: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load' 16: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/rails:4:in `<top (required)>' 15: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/bin/rails:4:in `require_relative' 14: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/config/boot.rb:4:in `<top (required)>' 13: from /Users/satoukouta/Documents/Rails_apps/fourth_app/book_master/config/boot.rb:4:in `require' 12: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/setup.rb:2:in `<top (required)>' 11: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/setup.rb:2:in `require_relative' 10: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap.rb:5:in `<top (required)>' 9: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap.rb:5:in `require_relative' 8: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache.rb:61:in `<top (required)>' 7: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache.rb:61:in `require_relative' 6: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache/store.rb:4:in `<top (required)>' 5: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/explicit_require.rb:40:in `with_gems' 4: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/explicit_require.rb:44:in `rescue in with_gems' 3: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache/store.rb:4:in `block in <top (required)>' 2: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.1/lib/bootsnap/load_path_cache/store.rb:4:in `require' 1: from /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `<top (required)>' /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `require': dlopen(/Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle, 9): no suitable image found. Did find: (LoadError) /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle: mach-o, but wrong architecture /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle: mach-o, but wrong architecture - /Users/satoukouta/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle
環境変数、パス(zshrcファイル)
export PATH=/opt/homebrew/bin:$PATH export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH" export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib" export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include" export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig" export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/homebrew/opt/openssl@1.1" export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH" if [[ -s ~/.nvm/nvm.sh ]]; then source ~/.nvm/nvm.sh fi
試したこと
rails new をした後その階層に潜りrailsコマンドを実行すると全てこのコマンドが返されてしまいます。
bundle updateなどを行いました
補足情報(FW/ツールのバージョンなど)
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
rails 6.1.1
os m1 mac
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。