gpt4 book ai didi

ruby-on-rails - 在 Rails Gemfile 中指定多个 gem 约束的语法是什么?

转载 作者:行者123 更新时间:2023-12-02 17:15:46 26 4
gpt4 key购买 nike

多重依赖的 Gemfile 的正确语法是什么?

尝试使用 Capistrano 时,我收到一条错误消息:

cap aborted!
NotImplementedError: unsupported key type `ssh-ed25519'
net-ssh requires the following gems for ed25519 support:
* rbnacl (>= 3.2, < 5.0)
* rbnacl-libsodium, if your system doesn't have libsodium installed.
* bcrypt_pbkdf (>= 1.0, < 2.0)
See https://github.com/net-ssh/net-ssh/issues/478 for more information
Gem::LoadError : "can't activate rbnacl (< 5.0, >= 3.2.0), already activated rbnacl-5.0.0. Make sure all dependencies are added to Gemfile."

我将以下内容放入我的 Gemfile 中:

gem 'rbnacl', '>= 3.2, < 5.0', :require => false
gem 'rbnacl-libsodium', :require => false
gem 'bcrypt_pbkdf', '>= 1.0, < 2.0', :require => false

gems(和 req false)之前在 Gemfile 中。

当我添加版本要求时,bundle install 出现以下错误:

[!] There was an error parsing `Gemfile`: Illformed requirement [">= 3.2, < 5.0"]. Bundler cannot continue.

# from /Users/myname/MySite/Gemfile:70
# -------------------------------------------
# gem 'capistrano-maintenance', '~> 1.0', :require => false
> gem 'rbnacl', '>= 3.2, < 5.0', :require => false
# gem 'rbnacl-libsodium', :require => false
# -------------------------------------------

最佳答案

使用数组或者只是列出来:

gem 'rbnacl', ['>= 3.2', '< 5.0']
gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0'

关于ruby-on-rails - 在 Rails Gemfile 中指定多个 gem 约束的语法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46615856/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com