-1

我正在尝试将我的 ruby​​ 从包管理器2.5(当前)安装的 ruby​​ 升级到2.6using snap. 我就是这样做的

sudo snap install ruby --classic

/usr/bin/ruby符号链接到包管理器安装的 stable ruby​​。去掉它。

sudo rm /usr/bin/ruby

确保您的 PATH 环境变量包括/snap/bin

现在我要删除包管理器安装的 ruby​​。

$ sudo apt remove --purge ruby
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  geoipupdate lame libadns1 libjs-jquery-easing libjs-jquery-fancybox
  libjs-jquery-mousewheel libjs-source-map libjs-uglify
  libnumber-bytes-human-perl nginx python-adns python-easygui
  python-levenshtein python-metaconfig ruby-did-you-mean ruby-minitest
  ruby-net-telnet ruby-power-assert ruby-test-unit ruby-xmlrpc ruby2.5-doc
  rubygems-integration u3-tool vim-gui-common
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  armitage* beef-xss* bundler* cewl* commix* dradis* ghost-phisher*
  gpp-decrypt* jboss-autopwn* libruby2.5* maltego-teeth* metasploit-framework*
  msfpc* pipal* rake* rsmangler* ruby* ruby-activesupport* ruby-addressable*
  ruby-ansi* ruby-atomic* ruby-buftok* ruby-bundler* ruby-celluloid*
  ruby-celluloid-io* ruby-cms-scanner* ruby-concurrent* ruby-daemons*
  ruby-dataobjects* ruby-dataobjects-mysql* ruby-dataobjects-postgres*
  ruby-dataobjects-sqlite3* ruby-dev* ruby-diff-lcs* ruby-dm-core*
  ruby-dm-do-adapter* ruby-dm-migrations* ruby-dm-sqlite-adapter* ruby-docile*
  ruby-domain-name* ruby-em-websocket* ruby-equalizer* ruby-erubis*
  ruby-espeak* ruby-ethon* ruby-eventmachine* ruby-execjs* ruby-ffi*
  ruby-hitimes* ruby-http* ruby-http-cookie* ruby-http-form-data*
  ruby-http-parser.rb* ruby-httpclient* ruby-i18n* ruby-json* ruby-librex*
  ruby-maxmind-db* ruby-memoizable* ruby-mime* ruby-mime-types*
  ruby-mime-types-data* ruby-mini-exiftool* ruby-mojo-magick* ruby-molinillo*
  ruby-msfrpc-client* ruby-msgpack* ruby-multi-json* ruby-multipart-post*
  ruby-mustermann* ruby-naught* ruby-net-http-digest-auth*
  ruby-net-http-persistent* ruby-netrc* ruby-nio4r* ruby-nokogiri* ruby-oj*
  ruby-opt-parse-validator* ruby-parseconfig* ruby-pkg-config*
  ruby-progressbar* ruby-public-suffix* ruby-qr4r* ruby-rack*
  ruby-rack-protection* ruby-rchardet* ruby-rest-client* ruby-rqrcode*
  ruby-rspec-expectations* ruby-rspec-support* ruby-rubydns* ruby-rushover*
  ruby-simple-oauth* ruby-simplecov* ruby-simplecov-html* ruby-sinatra*
  ruby-slack-notifier* ruby-snmp* ruby-spider* ruby-sqlite3*
  ruby-term-ansicolor* ruby-thor* ruby-thread-safe* ruby-tilt* ruby-timers*
  ruby-tins* ruby-twitter* ruby-typhoeus* ruby-tzinfo* ruby-uglifier*
  ruby-unf* ruby-unf-ext* ruby-yajl* ruby-zip* ruby2.5* ruby2.5-dev* set*
  snmpcheck* thin* twofi* u3-pwn* unicorn-magic* urlcrazy* vim-gtk* whatweb*
  wpscan*
0 upgraded, 0 newly installed, 126 to remove and 22 not upgraded.
After this operation, 748 MB disk space will be freed.
Do you want to continue? [Y/n]

基本上删除ruby意味着删除整个系统。无论如何以透明的方式替换 ruby​​,我不会被迫删除所有这些包?如果我用最新的系统推荐的红宝石替换snap系统稳定性会降低多少?

$ uname -r
4.19.0-kali4-amd64
4

1 回答 1

0

您是否尝试过频道选项?

ruby-lang.org 上的Ruby 新闻提到以下内容:

我们的 snap 使用“通道”功能同时发布多个 Ruby 系列。例如,不指定频道,当前将安装 Ruby 2.5.3。但是如果要使用 Ruby 2.4,请指定 2.4 通道,如下所示:sudo snap install ruby --classic --channel=2.4/stable

也许有更多关于Github的信息。

当然,Iceman 提到的 rbenv 和rvm也是一种选择。

于 2019-05-03T23:05:52.223 回答