无法升级 ruby 以安装 shopify 客户端

Coundn't upgrade ruby to install shopify client

我在安装 Shopify 客户端时遇到此错误。

[sudo] password for massil: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'shopify-cli' instead of './shopify-cli-2.1.0.deb'
The following NEW packages will be installed
  shopify-cli
0 to upgrade, 1 to newly install, 0 to remove, and 1 not to upgrade.
Need to get 0 B/956 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 /<path-to-.deb-file>/shopify-cli-2.1.0.deb shopify-cli all 2.1.0 [956 B]
(Reading database ... 337058 files and directories currently installed.)
Preparing to unpack .../shopify/shopify-cli-2.1.0.deb ...
ERROR:  Error installing shopify-cli:
    There are no versions of theme-check (~> 1.1) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?
    theme-check requires Ruby version >= 2.6. The current ruby version is 2.5.0.
dpkg: error processing archive /<path-to-.deb-file>/shopify-cli-2.1.0.deb (--unpack):
 new shopify-cli package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /<path-to-.deb-file>/shopify-cli-2.1.0.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

这似乎是 ruby 2.5 版的问题。我尝试使用 apt 将它更新到更高版本,但它一直告诉我它是最新的。然后我使用 rbenvrvm 来安装更高版本,但它似乎总是使用系统安装的一个来安装 Shopify 客户端。

我正在使用 ubuntu 18.04

编辑: 我最终使用 gem install shopify-cli _2.7.2_ --version 进行安装。

这是因为

主题检查库不适用于 ruby 低于 2.6 的版本。

不幸的是,使用标准方式安装 ruby:

sudo apt install ruby-full

是否安装版本:

ruby 2.5.1p57(2018-03-29 修订版 63029)[x86_64-linux-gnu]

但可以按照rbenv方法安装更高版本

cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby- 
build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> 
~/.bashrc
exec $SHELL

rbenv install 3.0.2
rbenv global 3.0.2
ruby -v

版本ruby之后应该是

ruby 3.0.2p107(2021-07-07 修订版 0db68f0233)[x86_64-linux]

和运行

 gem install shopify-cli

安装最新的 shopify-cli

如果此方法不起作用,请尝试使用此处描述的其他 2 个 Install Ruby On Rails on Ubuntu18.04 仿生海狸