前提・実現したいこと
WSL上でubuntuを使ってアプリケーション開発しています。
ruby on railsです。
rails g controller コマンドでエラーが出てしまいます。
対処方を教えてください。
発生している問題・エラーメッセージ
$ bin/rails g controller top index
Traceback (most recent call last):
23: from /home/shutax/.gem/gems/spring-3.1.1/bin/spring:49:in <main>' 22: from /home/shutax/.gem/gems/spring-3.1.1/lib/spring/client.rb:30:in
run'
21: from /home/shutax/.gem/gems/spring-3.1.1/lib/spring/client/command.rb:7:in call' 20: from /home/shutax/.gem/gems/spring-3.1.1/lib/spring/client/server.rb:9:in
call'
19: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in require' 18: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in
require'
17: from /home/shutax/.gem/gems/spring-3.1.1/lib/spring/server.rb:9:in <top (required)>' 16: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in
require'
15: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in require' 14: from /home/shutax/.gem/gems/spring-3.1.1/lib/spring/commands.rb:4:in
<top (required)>'
13: from /home/shutax/.gem/gems/spring-3.1.1/lib/spring/commands.rb:33:in <module:Spring>' 12: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in
require'
11: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in require' 10: from /usr/lib/ruby/2.7.0/bundler/setup.rb:20:in
<top (required)>'
9: from /usr/lib/ruby/2.7.0/bundler/ui/shell.rb:88:in silence' 8: from /usr/lib/ruby/2.7.0/bundler/ui/shell.rb:136:in
with_level'
7: from /usr/lib/ruby/2.7.0/bundler/setup.rb:20:in block in <top (required)>' 6: from /usr/lib/ruby/2.7.0/bundler.rb:149:in
setup'
5: from /usr/lib/ruby/2.7.0/bundler/runtime.rb:22:in setup' 4: from /usr/lib/ruby/2.7.0/bundler/shared_helpers.rb:76:in
set_bundle_environment'
3: from /usr/lib/ruby/2.7.0/bundler/shared_helpers.rb:297:in set_bundle_variables' 2: from /usr/lib/ruby/2.7.0/bundler/rubygems_integration.rb:223:in
bin_path'
1: from /usr/lib/ruby/2.7.0/rubygems.rb:254:in bin_path' /usr/lib/ruby/2.7.0/rubygems.rb:277:in
find_spec_for_exe': Could not find 'bundler' (2.2.32) required by your /home/shutax/rails/asagao/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run bundle update --bundler
.
To install the missing version, run gem install bundler:2.2.32
該当のソースコード
rails g controller
試したこと
bundle update --bundler
gem install bundler:2.2.32
エラーコードに書かれているコマンドを実行したのですが、同じ内容のエラーが出てしまいます。
補足情報(FW/ツールのバージョンなど)
ubuntu 18.04
Windows 10
ruby 2.7.5p203
rails 6.1.4.1
bundle 2.2.32
gem 3.1.6
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/12/07 23:29