ruby-on-rails - 即使在捆绑安装之后,rails 也找不到 gem
问题描述
我目前正在尝试在执行bundle install
. 但是,当我尝试这样做时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.
然后我运行bundle install
但弹出相同的错误。我也尝试过byebug
在 gemfile 中删除,但它只是给了我同样的错误,但使用了不同的 gem。我尝试使用单独安装 byebug,gem install byebug -v 9.0.6
但同样的问题仍然存在。
这是我的宝石文件
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
您应该在捆绑包的上下文中运行您的 rails 服务器。
推荐阅读
- javascript - 错误的相对目录路径:无法导入 GraphQl 文件
- reactjs - reactjs路由到不同页面的特定部分
- excel - 有没有办法设置每月扣除的价值?
- swift - 在 Swift 中遵守空协议有什么意义
- python - Pandas/sklearn:向量化大量线性回归计算
- twilio - Twilio WhatsApp Autopilot - 如何开始对话
- java - 如何将数据表单 jps 传递给 servlet?
- sql - 连接来自不同表的公共列并选择第一个填充最多的列
- java - 有没有办法只获取 JavaFX 中的标题栏高度?
- powershell - 在模块内定义私有函数的约定和原生支持