ローカル環境にRailsのプロジェクトを作成したいのですが、コマンドを打つとエラーメッセージが表示されます。
#実行したコマンド
ruby
1Rails new practice -d postgresql
発生したエラー
Traceback (most recent call last):
2: from /usr/local/bin/Rails:22:in <main>' 1: from /Users/apple/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems.rb:252:in
bin_path'
/Users/apple/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': can't find gem railties (>= 0.a) with executable rails (Gem::GemNotFoundException)
#環境情報
OS:Mac
ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin18]
rbenv -v
rbenv 1.1.2
rails -v
Traceback (most recent call last):
2: from /usr/local/bin/rails:22:in <main>' 1: from /Users/apple/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems.rb:252:in
bin_path'
/Users/apple/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': can't find gem railties (>= 0.a) with executable rails (Gem::GemNotFoundException)
ローカルにrailsが入っていない、ということなのでしょうか。
Rails初学者のため、原因の切り分け方が分かりません。
どなたか、何がインストールされている必要があるか、などご教示いただけますと大変ありがたいです。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。