简体   繁体   English

即使在捆绑安装后,rails 也找不到 gem

[英]rails cannot find gems even after bundle install

I am currently trying to start my rails server after doing a bundle install .我目前正在尝试在执行bundle install后启动我的 rails 服务器。 However, when I try to do rails s , this error pops up但是,当我尝试执行rails s ,会弹出此错误

Could not find gem 'byebug (= 9.0.6)' in any of the gem sources listed in your Gemfile. Run bundle install to install missing gems.

I then run bundle install but the same error pops up.然后我运行bundle install但弹出相同的错误。 I've also tried getting rid of byebug in the gemfile but it just gives me the same error but with a different gem.我也试过在byebug中摆脱byebug ,但它只是给了我同样的错误,但使用了不同的 gem。 I've tried installing byebug individually using gem install byebug -v 9.0.6 but the same problem persists.我已经尝试使用gem install byebug -v 9.0.6单独gem install byebug -v 9.0.6但同样的问题仍然存在。

This is my gemfile这是我的 gemfile

 source 'https://rubygems.org' gem 'rails', '5.1.6' gem 'puma', '3.9.1' gem 'sass-rails', '5.0.6' gem 'uglifier', '3.2.0' gem 'coffee-rails', '4.2.2' gem 'jquery-rails', '4.3.1' gem 'turbolinks', '5.0.1' gem 'jbuilder', '2.7.0' group :development, :test do gem 'sqlite3', '1.3.12' # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', '9.0.6', platform: :mri end group :development do gem 'web-console', '3.5.1' gem 'listen', '3.1.5' gem 'spring', '2.0.2' gem 'spring-watcher-listen', '2.0.1' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

您应该在bundle exec rails s上下文中运行带有bundle exec rails s rails服务器。

In my case, there was a following line in .bundle/config就我而言,.bundle/config 中有以下一行

BUNDLE_WITHOUT: "test:development"

After removing that line and running bundle install , everything works fine.删除该行并运行bundle install ,一切正常。

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

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