尝试加载gem’sass-rails’时出错。 (捆扎机:: GemRequireError)

我在启动rails服务器时遇到错误。

C:\Ruby22-x64\WebAppRails>rails s C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'sass-rails'. (Bundler::GemRequireError) from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require' from C:/Ruby22-x64/WebAppRails/config/application.rb:7:in `' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `require' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `block in server' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `' from bin/rails:4:in `require' from bin/rails:4:in `' 

这是我正在使用的gem:

 C:\Ruby22-x64\WebAppRails>bundle show 

捆绑包含的gem:

  • 动作制作者(4.2.6)
  • actionpack(4.2.6)
  • actionview(4.2.6)
  • activejob(4.2.6)
  • activemodel(4.2.6)
  • activerecord(4.2.6)
  • activesupport(4.2.6)
  • arel(6.0.3)
  • binding_of_caller(0.7.2)
  • 建设者(3.2.2)
  • 捆绑(1.11.2)
  • byebug(8.2.5)
  • 咖啡栏(4.1.1)
  • 咖啡脚本(2.4.1)
  • coffee-script-source(1.10.0)
  • concurrent-ruby(1.0.1)
  • debug_inspector(0.0.2)
  • erubis(2.7.0)
  • execjs(2.6.0)
  • globalid(0.3.6)
  • i18n(0.7.0)
  • jbuilder(2.4.1)
  • jquery-rails(4.1.1)
  • json(1.8.3)
  • 丝瓜络(2.0.3)
  • 邮件(2.6.4)
  • 哑剧型(3.0)
  • mime-types-data(3.2016.0221)
  • mini_portile2(2.0.0)
  • minitest(5.8.4)
  • multi_json(1.11.3)
  • nokogiri(1.6.7.2)
  • 机架(1.6.4)
  • 机架测试(0.6.3)
  • 铁轨(4.2.6)
  • rails-deprecated_sanitizer(1.0.3)
  • rails-dom-testing(1.0.7)
  • rails-html-sanitizer(1.0.3)
  • 铁路(4.2.6)
  • 耙子(11.1.2)
  • rdoc(4.2.2)
  • sass(3.4.22)
  • sass-rails(5.0.4)
  • sdoc(0.4.1)
  • 链轮(3.6.0)
  • 链轮导轨(3.0.4)
  • sqlite3(1.3.11)
  • 托尔(0.19.1)
  • thread_safe(0.3.5)
  • 倾斜(2.0.2)
  • turbolinks(2.5.3)
  • tzinfo(1.2.2)
  • tzinfo-data(1.2016.4)
  • uglifier(3.0.0)
  • 网络控制台(2.3.0)

gem版本是2.4.5.1,ruby版本是2.2.4

我需要做些什么来解决这个问题?

将以下内容添加到Gemfile:

 gem 'sass-rails', '>= 5.0.3' 

并做

 bundle update sass-rails 

当我为我刚刚克隆的Rails应用程序安装适当版本的Ruby时,我的问题得到了解决 – 我安装了2.4.1但我的应用程序需要2.3。