Skip to main content
Communityユーザーがトップに表示した
Communityユーザーがトップに表示した
Communityユーザーがトップに表示した
Communityユーザーがトップに表示した
本文に 6 文字追加
ソース リンク
cubick
  • 2.1万
  • 5
  • 27
  • 64

■参考画像

画像の説明をここに入力

■iterms画面(文字列貼り付け)
hirokinagai@HirokinoMBP ~ % gem list
internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require': cannot load such file -- psych (LoadError) from <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in load_yaml' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in load_file'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in initialize' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in new'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in do_configuration' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in run'
from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in <main>' hirokinagai@HirokinoMBP ~ % gem install rails -v 7.0.4 <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require': cannot load such file -- psych (LoadError)
from internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in load_yaml'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in load_file' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in initialize'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in new' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in do_configuration'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in run' from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in '
hirokinagai@HirokinoMBP ~ % ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]
hirokinagai@HirokinoMBP ~ % rails -v
rbenv: rails: command not found

hirokinagai@HirokinoMBP ~ % gem list
<internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- psych (LoadError)
    from <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in `load_yaml'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in `load_file'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in `initialize'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in `new'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in `do_configuration'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in `run'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in `<main>'
hirokinagai@HirokinoMBP ~ % gem install rails -v 7.0.4
<internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- psych (LoadError)
    from <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in `load_yaml'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in `load_file'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in `initialize'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in `new'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in `do_configuration'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in `run'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in `<main>'
hirokinagai@HirokinoMBP ~ % ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]
hirokinagai@HirokinoMBP ~ % rails -v
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
  2.7.6

hirokinagai@HirokinoMBP ~ % which ruby
/Users/hirokinagai/.rbenv/shims/ruby
hirokinagai@HirokinoMBP ~ % which rails
/Users/hirokinagai/.rbenv/shims/rails
hirokinagai@HirokinoMBP ~ % which gem
/Users/hirokinagai/.rbenv/shims/gem
hirokinagai@HirokinoMBP ~ % bundle install
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ % bundle update
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ %

The `rails' command exists in these Ruby versions:
2.7.6■参考画像

hirokinagai@HirokinoMBP ~ % which ruby
/Users/hirokinagai/.rbenv/shims/ruby
hirokinagai@HirokinoMBP ~ % which rails
/Users/hirokinagai/.rbenv/shims/rails
hirokinagai@HirokinoMBP ~ % which gem
/Users/hirokinagai/.rbenv/shims/gem
hirokinagai@HirokinoMBP ~ % bundle install
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ % bundle update
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ %画像の説明をここに入力

■参考画像

画像の説明をここに入力

■iterms画面(文字列貼り付け)
hirokinagai@HirokinoMBP ~ % gem list
internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require': cannot load such file -- psych (LoadError) from <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in load_yaml' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in load_file'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in initialize' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in new'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in do_configuration' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in run'
from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in <main>' hirokinagai@HirokinoMBP ~ % gem install rails -v 7.0.4 <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require': cannot load such file -- psych (LoadError)
from internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in load_yaml'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in load_file' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in initialize'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in new' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in do_configuration'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in run' from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in '
hirokinagai@HirokinoMBP ~ % ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]
hirokinagai@HirokinoMBP ~ % rails -v
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
2.7.6

hirokinagai@HirokinoMBP ~ % which ruby
/Users/hirokinagai/.rbenv/shims/ruby
hirokinagai@HirokinoMBP ~ % which rails
/Users/hirokinagai/.rbenv/shims/rails
hirokinagai@HirokinoMBP ~ % which gem
/Users/hirokinagai/.rbenv/shims/gem
hirokinagai@HirokinoMBP ~ % bundle install
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ % bundle update
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ %

■iterms画面(文字列貼り付け)

hirokinagai@HirokinoMBP ~ % gem list
<internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- psych (LoadError)
    from <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in `load_yaml'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in `load_file'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in `initialize'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in `new'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in `do_configuration'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in `run'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in `<main>'
hirokinagai@HirokinoMBP ~ % gem install rails -v 7.0.4
<internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- psych (LoadError)
    from <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in `load_yaml'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in `load_file'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in `initialize'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in `new'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in `do_configuration'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in `run'
    from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in `<main>'
hirokinagai@HirokinoMBP ~ % ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]
hirokinagai@HirokinoMBP ~ % rails -v
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
  2.7.6

hirokinagai@HirokinoMBP ~ % which ruby
/Users/hirokinagai/.rbenv/shims/ruby
hirokinagai@HirokinoMBP ~ % which rails
/Users/hirokinagai/.rbenv/shims/rails
hirokinagai@HirokinoMBP ~ % which gem
/Users/hirokinagai/.rbenv/shims/gem
hirokinagai@HirokinoMBP ~ % bundle install
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ % bundle update
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ %

■参考画像

画像の説明をここに入力

文字列として貼り付け
ソース リンク

■iterms画面(文字列貼り付け)
hirokinagai@HirokinoMBP ~ % gem list
internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require': cannot load such file -- psych (LoadError) from <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in load_yaml' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in load_file'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in initialize' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in new'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in do_configuration' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in run'
from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in <main>' hirokinagai@HirokinoMBP ~ % gem install rails -v 7.0.4 <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require': cannot load such file -- psych (LoadError)
from internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in load_yaml'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in load_file' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in initialize'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in new' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in do_configuration'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in run' from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in '
hirokinagai@HirokinoMBP ~ % ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]
hirokinagai@HirokinoMBP ~ % rails -v
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
2.7.6

hirokinagai@HirokinoMBP ~ % which ruby
/Users/hirokinagai/.rbenv/shims/ruby
hirokinagai@HirokinoMBP ~ % which rails
/Users/hirokinagai/.rbenv/shims/rails
hirokinagai@HirokinoMBP ~ % which gem
/Users/hirokinagai/.rbenv/shims/gem
hirokinagai@HirokinoMBP ~ % bundle install
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ % bundle update
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ %

■iterms画面(文字列貼り付け)
hirokinagai@HirokinoMBP ~ % gem list
internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require': cannot load such file -- psych (LoadError) from <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in load_yaml' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in load_file'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in initialize' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in new'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in do_configuration' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in run'
from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in <main>' hirokinagai@HirokinoMBP ~ % gem install rails -v 7.0.4 <internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require': cannot load such file -- psych (LoadError)
from internal:/Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems.rb:609:in load_yaml'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:346:in load_file' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/config_file.rb:189:in initialize'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in new' from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:73:in do_configuration'
from /Users/hirokinagai/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/gem_runner.rb:38:in run' from /Users/hirokinagai/.rbenv/versions/3.1.2/bin/gem:21:in '
hirokinagai@HirokinoMBP ~ % ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]
hirokinagai@HirokinoMBP ~ % rails -v
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
2.7.6

hirokinagai@HirokinoMBP ~ % which ruby
/Users/hirokinagai/.rbenv/shims/ruby
hirokinagai@HirokinoMBP ~ % which rails
/Users/hirokinagai/.rbenv/shims/rails
hirokinagai@HirokinoMBP ~ % which gem
/Users/hirokinagai/.rbenv/shims/gem
hirokinagai@HirokinoMBP ~ % bundle install
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ % bundle update
Could not locate Gemfile
hirokinagai@HirokinoMBP ~ %

本文に 49 文字追加
ソース リンク
cubick
  • 2.1万
  • 5
  • 27
  • 64

(初学者)rails7 Rails 7.0.4インストールができない  (エラー:cannot load such file -- psych (LoadError))

初学者です。拙い質問ですが、どうかご助言頂けますでしょうか。

背景/現状

■背景/現状
ruby3Ruby 3.1.2とrails7 と Rails 7.0.4用いて、ローカルに開発環境を構築したい

環境

■環境
MM1チップ
Big Sur ver1 11.2.3
rubyRuby 3.1.2

やりたいこと

■やりたいこと
rails7Rails 7.0.4インストールしたい

実際に出てるエラーメッセージ

■実際に出てるエラーメッセージ
gem install rails -v 7.0.4実行gem install rails -v 7.0.4 実行

cannot load such file -- psych (LoadError)

cannot load such file -- psych (LoadError)

既に試したこと

■既に試したこと
rbenvrbenvアンインストール後、再度インストールし実行

他におかしいと思うこと

■他におかしいと思うこと
・rails -v実行rails -v 実行、zsh、"zsh: command not found: railsがrails" が出ずに以下が出る
rails -v
rbenv: rails: command not found

rails -v
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
  2.7.6

The `rails' command exists in these Ruby versions:
2.7.6bundle install 実行時

・bundle install実行時
Could"Could not locate Gemfileとの" と表示される

■参考画像
  

画像の説明をここに入力

(初学者)rails704インストールができない(エラー:cannot load such file -- psych (LoadError))

初学者です。拙い質問ですが、どうかご助言頂けますでしょうか。

■背景/現状
ruby312とrails7.0.4用いて、ローカルに開発環境を構築したい

■環境
M1チップ
Big Sur ver11.2.3
ruby 312

■やりたいこと
rails7.0.4インストールしたい

■実際に出てるエラーメッセージ
gem install rails -v 7.0.4実行

cannot load such file -- psych (LoadError)

■既に試したこと
rbenvアンインストール後、再度インストールし実行

■他におかしいと思うこと
・rails -v実行、zsh: command not found: railsが出ずに以下が出る
rails -v
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
2.7.6

・bundle install実行時
Could not locate Gemfileとの表示

■参考画像
 画像の説明をここに入力

Rails 7.0.4インストールができない  (エラー:cannot load such file -- psych (LoadError))

背景/現状

Ruby 3.1.2 と Rails 7.0.4用いて、ローカルに開発環境を構築したい

環境

M1チップ
Big Sur ver 11.2.3
Ruby 3.1.2

やりたいこと

Rails 7.0.4インストールしたい

実際に出てるエラーメッセージ

gem install rails -v 7.0.4 実行

cannot load such file -- psych (LoadError)

既に試したこと

rbenvアンインストール後、再度インストールし実行

他におかしいと思うこと

rails -v 実行、"zsh: command not found: rails" が出ずに以下が出る

rails -v
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
  2.7.6

bundle install 実行時

"Could not locate Gemfile" と表示される

■参考画像 

画像の説明をここに入力

ソース リンク
読み込んでいます