繁体   English   中英

尝试加载gem'sass-rails'时出错。 (捆绑器:: GemRequireError)

[英]There was an error while trying to load the gem 'sass-rails'. (Bundler::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 `<top (required)>'
        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 `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

这是我正在使用的宝石:

C:\Ruby22-x64\WebAppRails>bundle show

捆绑包中包含的宝石:

  • 动作邮件程序(4.2.6)
  • 动作包(4.2.6)
  • 动作视图(4.2.6)
  • 活动作业(4.2.6)
  • 活动模型(4.2.6)
  • 活动记录(4.2.6)
  • 主动支持(4.2.6)
  • 竞技场(6.0.3)
  • binding_of_caller(0.7.2)
  • 建造者(3.2.2)
  • 捆绑器(1.11.2)
  • 再见(8.2.5)
  • 咖啡轨(4.1.1)
  • 咖啡脚本(2.4.1)
  • coffee-script-source(1.10.0)
  • 并发红宝石(1.0.1)
  • debug_inspector(0.0.2)
  • erubis(2.7.0)
  • execjs(2.6.0)
  • 全局(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类型数据(3.2016.0221)
  • mini_portile2(2.0.0)
  • 最小测试(5.8.4)
  • multi_json(1.11.3)
  • 诺基亚(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)
  • 无礼(3.4.22)
  • 粗轨(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。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM