LoadError:无法加载“监 听”宝石(轨道 5)
P粉087074897
P粉087074897 2023-10-20 12:50:56
0
2
344

我有一个 API 模式 Rails 5 应用程序,它不允许我运行 rake pathsrails s。我得到的错误是:

$ rake routes
rake aborted!
LoadError: Could not load the 'lis ten' gem. Add `gem 'lis ten'` to the development group of your Gemfile
.../config/environment.rb:5:in `<top (required)>'
LoadError: cannot load such file -- lis ten
.../config/environment.rb:5:in `<top (required)>'
Tasks: TOP => routes => environment
(See full trace by running task with --trace)

我已经验证 li sten 位于我的 Gemfile 的开发组中:

group :development do
  gem 'lis ten', '~> 3.1.5'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-li sten', '~> 2.0.0'
end

它在我的 Gemfile.lock 中:

$ cat Gemfile.lock | grep 'li sten'
    li sten (3.1.5)
    spring-watcher-l isten (2.0.0)
      li sten (>= 2.7, < 4.0)
  list en (~> 3.1.5)
  spr ing-watcher-lis ten (~> 2.0.0)

我已经更新了捆绑包,安装了捆绑包,并验证了 gem install Li sten 是否有效。这是本周早些时候的工作,但我没有运气通过我的承诺。

$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]

我在 vendor/cache 中没有看到它,但我不知道该怎么做...

$ bundle package | grep 'li sten'

感谢您的帮助!

更新:

我可以通过将 gem 'lis ten', '~> 3.1.5' 放入全局 Gemfile 中来“修复”该问题(并将其从 :development 中删除)。然后所有错误都会消失,一切正常,但这似乎是错误的。

P粉087074897
P粉087074897

热门教程
더>
最新下载
더>
网站特效
网站源码
网站素材
프론트엔드 템플릿
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!