前提・実現したいこと
railsで"rails g controller home top"を実行したい。
初学者です。
railsの環境構築中です。
railsのサーバーを起動して、アクセス(ブラウザで表示)することはできていますが、
アプリケーションにcontrollerを作成するタイミングでエラーが発生します。
OS:macOS Catalina 10.15.5
Ruby: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]
rbenv: 1.1.2
Rails: 6.1.1
発生している問題・エラーメッセージ
$ rails g controller home top
上記実行時に下記エラーが発生する。
Could not find racc-1.5.2 in any of the sources (Bundler::GemNotFound)
該当のソースコード
:sample_app XXXX$ rails g controller home top
Traceback (most recent call last):
22: from /Library/Ruby/Gems/2.6.0/gems/spring-2.1.1/bin/spring:49:in <main>' 21: from /Library/Ruby/Gems/2.6.0/gems/spring-2.1.1/lib/spring/client.rb:30:in
run'
20: from /Library/Ruby/Gems/2.6.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in call' 19: from /Library/Ruby/Gems/2.6.0/gems/spring-2.1.1/lib/spring/client/server.rb:9:in
call'
18: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' 17: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
require'
16: from /Library/Ruby/Gems/2.6.0/gems/spring-2.1.1/lib/spring/server.rb:9:in <top (required)>' 15: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
require'
14: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' 13: from /Library/Ruby/Gems/2.6.0/gems/spring-2.1.1/lib/spring/commands.rb:4:in
<top (required)>'
12: from /Library/Ruby/Gems/2.6.0/gems/spring-2.1.1/lib/spring/commands.rb:33:in <module:Spring>' 11: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
require'
10: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' 9: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/setup.rb:20:in
<top (required)>'
8: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler.rb:107:in setup' 7: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:20:in
setup'
6: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:108:in block in definition_method' 5: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/definition.rb:226:in
requested_specs'
4: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/definition.rb:237:in specs_for' 3: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/definition.rb:170:in
specs'
2: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/spec_set.rb:85:in materialize' 1: from /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/spec_set.rb:85:in
map!'
/Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize': Could not find racc-1.5.2 in any of the sources (Bundler::GemNotFound)
### 試したこと ・racc-1.5.2が見つからないようだったので、racc-1.5.2を個別にインストール $ bundle show raccの実行結果↓ The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. /Users/XXXX/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/racc-1.5.2 ・gem list↓ *** LOCAL GEMS *** actioncable (6.1.1) actionmailbox (6.1.1) actionmailer (6.1.1) actionpack (6.1.1) actiontext (6.1.1) actionview (6.1.1) activejob (6.1.1) activemodel (6.1.1) activerecord (6.1.1) activestorage (6.1.1) activesupport (6.1.1) addressable (2.7.0) bigdecimal (default: 1.4.1) bindex (0.8.1) bootsnap (1.7.1) builder (3.2.4) bundler (2.2.9, default: 1.17.2) byebug (11.1.3) capybara (3.35.3) childprocess (3.0.0) cmath (default: 1.0.0) concurrent-ruby (1.1.8) crass (1.0.6) csv (default: 3.0.9) date (default: 2.0.0) dbm (default: 1.0.0) did_you_mean (1.3.0) e2mmap (default: 0.1.0) erubi (1.10.0) etc (default: 1.0.1) fcntl (default: 1.0.0) ffi (1.14.2) fiddle (default: 1.0.0) fileutils (default: 1.1.0) forwardable (default: 1.2.0) globalid (0.4.2) i18n (1.8.8) io-console (default: 0.4.7) ipaddr (default: 1.2.2) irb (default: 1.0.0) jbuilder (2.11.2) json (default: 2.1.0) listen (3.4.1) logger (default: 1.3.0) loofah (2.9.0) mail (2.7.1) marcel (0.3.3) matrix (default: 0.1.0) method_source (1.0.0) mimemagic (0.3.5) mini_mime (1.0.2) mini_portile2 (2.5.0) minitest (5.14.3, 5.11.3) msgpack (1.4.2) mutex_m (default: 0.1.0) net-telnet (0.2.0) nio4r (2.5.5) nokogiri (1.11.1 x86_64-darwin) openssl (default: 2.1.2) ostruct (default: 0.1.0) power_assert (1.1.3) prime (default: 0.1.0) psych (default: 3.1.0) public_suffix (4.0.6) puma (5.2.1) **racc (1.5.2)** rack (2.2.3) rack-mini-profiler (2.3.1) rack-proxy (0.6.5) rack-test (1.1.0) rails (6.1.1) rails-dom-testing (2.0.3) rails-html-sanitizer (1.3.0) railties (6.1.1) rake (13.0.3, 12.3.2) rb-fsevent (0.10.4) rb-inotify (0.10.1) rdoc (default: 6.1.0) regexp_parser (2.0.3) rexml (default: 3.1.9) rss (default: 0.2.7) rubyzip (2.3.0) sass-rails (6.0.0) sassc (2.4.0) sassc-rails (2.1.2) scanf (default: 1.0.0) sdbm (default: 1.0.0) selenium-webdriver (3.142.7) semantic_range (2.3.1) shell (default: 0.7) spring (2.1.1) sprockets (4.0.2) sprockets-rails (3.2.2) sqlite3 (1.4.2) stringio (default: 0.0.2) strscan (default: 1.0.0) sync (default: 0.5.0) test-unit (3.2.9) thor (1.1.0) thwait (default: 0.1.0) tilt (2.0.10) tracer (default: 0.1.0) turbolinks (5.2.1) turbolinks-source (5.2.0) tzinfo (2.0.4) web-console (4.1.0) webdrivers (4.5.0) webpacker (5.2.1) webrick (default: 1.4.2) websocket-driver (0.7.3) websocket-extensions (0.1.5) xmlrpc (0.3.0) xpath (3.2.0) zeitwerk (2.4.2) zlib (default: 1.0.0) ### 補足情報(FW/ツールのバージョンなど) OS:macOS Catalina 10.15.5 Ruby: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19] rbenv: 1.1.2 Rails: 6.1.1
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。