ruby-on-rails - 为什么 Ruby on Rails Azure Web App 教程无法部署到远程?
问题描述
我正在尝试将Ruby on Rails 教程部署到 Microsoft Azure,并在推送到远程时继续遇到相同的错误:
remote: Bundle install with no 'without' options
remote: Defaulting gem installation directory to /tmp/bundle
remote: Defaulting site config directory to /home/site/config
remote: Using ruby version 2.6.2
remote: /home/site/wwwroot
remote: Found gemfile
remote: ~/site/wwwroot ~/site/repository
remote: Setting ruby version
remote: Running bundle clean
remote: /usr/local/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your /home/site/wwwroot/Gemfile.lock. (Gem::GemNotFoundException)
remote: Running bundle install
remote: To update to the latest version installed on your system, run `bundle update --bundler`.
remote: To install the missing version, run `gem install bundler:2.0.2`
remote: from /usr/local/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
remote: from /usr/local/.rbenv/versions/2.6.2/bin/bundle:23:in `<main>'
remote: /usr/local/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your /home/site/wwwroot/Gemfile.lock. (Gem::GemNotFoundException)
尝试修复:
- 确保我的 Ruby 版本与 Azure Web 应用的 (2.6.2) 匹配
- 尝试了多个版本的 Bundler(1.17.3、2.0.2 和 2.2.15)
- 确保我的 Gemfile 和 Gemfile.lock Bundler 版本匹配
- 尝试使用 Azure 的 Kudu Bash 交互来手动更新和安装 gems(没有这样的命令)
Azure Web App 是否有特定版本的 Bundler 请求?有什么方法可以找出我应该使用哪个 Bundler 版本进行开发?
解决方案
通过将我的 Bundler 版本降级到我安装的默认版本(1.17.2),我能够找到部署解决方案。更新我的 Gemfile.lock 以反映当前(默认)版本后,推送到远程成功。
推荐阅读
- android - 颤振:添加http依赖项时出错
- python - 错误:_pickle.PicklingError:不能腌制
在 0x0000002F2175B048>:属性查找 在 __main__ 上失败 - ios - iOS 应用程序中的 PayPal 集成
- java - 无法使用 AWS 安全令牌找到到所请求目标的有效认证路径
- python - discord.ext.commands.errors.CommandInvokeError:命令引发异常:KeyError:'price_change_pct'
- swift - 符合协议时类型别名声明的冗余重复
- javascript - 带有日期选择器的输入字段不会出现在 Chrome 或 Edge 中
- go - 创建字节对象的问题
- android - Flutter multi_image_picker 相机选项未在 iOS 中显示。当我已经启用相机并在 info.plist 中写入权限时
- codeigniter - 模块的 Codeigniter 4 资产路径配置