无法将更新后的引导程序宝石加载到轨道中

时间:2019-05-07 05:57:53

标签: ruby-on-rails twitter-bootstrap rubygems

Bootstrap过去在Rails上表现出色!现在,我遇到了一个非常奇怪的错误。

我以前使用的是Bootstrap gem的旧版本(如果我没记错的话,它是4.1.3)。但是,当我按下Rails应用程序时,Github给了我这个有关警报的提示:

  

在4.3.1之前的Bootstrap 4和3.4.1之前的Bootstrap 3中,XSS为   可能在工具提示或弹出式窗口数据模板属性中。欲了解更多   信息,请参阅:   https://blog.getbootstrap.com/2019/02/13/bootstrap-4-3-1-and-3-4-1/

了解,这是我想的。现在,逻辑上要做的是更新我的gemfile,以使bootstrap gem依赖项语句如下所示:

gem "bootstrap", ">= 4.3.1"

足够容易。添加完后,运行bundle install,然后重新启动服务器,我得到了这个错误:

/Users/myusername/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- bootstrap (LoadError)

很奇怪吧?我实际上在两种不同的情况下遇到此错误:

  1. 我有一个Rails引擎,它也依赖于引导程序,我在自己的应用程序中将其用作宝石。每当我尝试添加最新版本的bootstrap gem作为依赖项时,都会出现此错误。
  2. 将引导程序添加到我的gemfile时,也像使用任何常规gem和应用程序一样,也会出现此错误。

我该如何解决该错误?任何帮助表示赞赏!

这是我的完整堆栈跟踪记录

Traceback (most recent call last):
    59: from bin/rails:3:in `<main>'
    58: from bin/rails:3:in `load'
    57: from /Users/angelgarcia/Documents/Dev/websites/search-analysis-tool/bin/spring:15:in `<top (required)>'
    56: from /Users/angelgarcia/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:65:in `require'
    55: from /Users/angelgarcia/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:65:in `require'
    54: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
    53: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
    52: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
    51: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
    50: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
    49: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
    48: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
    47: from /Users/angelgarcia/Documents/Dev/websites/search-analysis-tool/bin/rails:9:in `<top (required)>'
    46: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
    45: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
    44: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
    43: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    42: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    41: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    40: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    39: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    38: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
    37: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
    36: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
    35: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    34: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    33: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    32: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `perform'
    31: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `tap'
    30: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:145:in `block in perform'
    29: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
    28: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
    27: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
    26: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    25: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    24: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    23: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    22: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    21: from /Users/angelgarcia/Documents/Dev/websites/search-analysis-tool/config/application.rb:7:in `<top (required)>'
    20: from /Users/angelgarcia/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
    19: from /Users/angelgarcia/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
    18: from /Users/angelgarcia/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
    17: from /Users/angelgarcia/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
    16: from /Users/angelgarcia/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
    15: from /Users/angelgarcia/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `block (2 levels) in require'
    14: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    13: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    12: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    11: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    10: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
     9: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/bundler/gems/elko-engine-f7b39674f535/lib/elko.rb:5:in `<top (required)>'
     8: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
     7: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
     6: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
     5: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require'
     4: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require'
     3: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
     2: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
     1: from /Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/angelgarcia/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- bootstrap (LoadError)

1 个答案:

答案 0 :(得分:0)

看起来像bootsnap gem的问题。尝试删除其缓存

rm -rf tmp/cache/bootsnap*