运行rails g controller
命令后,我得到的是我的错误:
在任何来源中找不到rake-12.2.1(Bundler :: GemNotFound)
/usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:87:in
block in materialize': Could not find rake-12.2.1 in any of the sources (Bundler::GemNotFound) from /usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:81:in
地图!'从 /usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:81:inmaterialize' from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:159:in
specs' 来自/usr/lib/ruby/vendor_ruby/bundler/definition.rb:218:inspecs_for' from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:207:in
requested_specs'从 /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:109:inblock in definition_method' from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:21:in
setup'从 /usr/lib/ruby/vendor_ruby/bundler.rb:101:insetup' from /usr/lib/ruby/vendor_ruby/bundler/setup.rb:20:in
' 从 /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in
需要&#39;从 /root/Desktop/blog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/commands.rb:33:in<module:Spring>' from /root/Desktop/blog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/commands.rb:4:in
&#39;从 /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in
需要&#39;从 /root/Desktop/blog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/server.rb:9:in<top (required)>' from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in
需要&#39;从 /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:inrequire' from /root/Desktop/blog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/server.rb:9:in
呼叫&#39;从 /root/Desktop/blog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:incall' from /root/Desktop/blog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in
运行&#39;从 /root/Desktop/blog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/bin/spring:49:in `&#39;
答案 0 :(得分:1)
我有同样的问题。我通过选择不同版本的ruby SDK来修复它。在我的情况下,它选择2.4.2而不是2.3.3,我认为默认安装在mac os上。