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

MER*_*ERM 2 capistrano ruby-on-rails gemfile

对于多个依赖项,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."
Run Code Online (Sandbox Code Playgroud)

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

gem 'rbnacl', '>= 3.2, < 5.0', :require => false
gem 'rbnacl-libsodium', :require => false
gem 'bcrypt_pbkdf', '>= 1.0, < 2.0', :require => false
Run Code Online (Sandbox Code Playgroud)

宝石(要求为false)以前在Gemfile中。

当我添加版本要求时,捆绑安装会出现以下错误:

[!] 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
 #  -------------------------------------------
Run Code Online (Sandbox Code Playgroud)

EJA*_*JAg 5

使用数组或将其列出:

gem 'rbnacl', ['>= 3.2', '< 5.0']
gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0'
Run Code Online (Sandbox Code Playgroud)