-
Notifications
You must be signed in to change notification settings - Fork 631
The announcement for snap release. #1888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
6dc64de
4ac6542
4af88f5
1b0f6c1
92c9a69
ac6dda4
c1685d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ There are several ways to install Ruby: | |
Here are available installation methods: | ||
|
||
* [Package Management Systems](#package-management-systems) | ||
* [Snap](#snap) | ||
* [Debian, Ubuntu](#apt) | ||
* [CentOS, Fedora, RHEL](#yum) | ||
* [Gentoo](#portage) | ||
|
@@ -68,6 +69,25 @@ versions instead of the latest release. To use the latest Ruby release, | |
check that the package name matches its version number. Or use a | ||
dedicated [installer][installers]. | ||
|
||
### snap (Ubuntu or other linux distribution) | ||
{: #snap} | ||
|
||
snap is the package system developed by Canonical. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
You can use it like this. | ||
|
||
{% highlight sh %} | ||
$ sudo snap install ruby --classic | ||
{% endhighlight %} | ||
|
||
You can also use multiple channels. The following commands switch to Ruby 2.3: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
{% highlight sh %} | ||
$ sudo snap switch ruby --channel=2.3/stable | ||
$ sudo snap refresh | ||
{% endhighlight %} | ||
|
||
snap should install the latest stable Ruby version. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
|
||
### apt (Debian or Ubuntu) | ||
{: #apt} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
layout: news_post | ||
title: The official ruby snap is available | ||
author: Hiroshi SHIBATA | ||
translator: | ||
date: 2018-11-08 14:58:28 +0000 | ||
lang: en | ||
--- | ||
|
||
We released the official snap package of Ruby language. | ||
|
||
https://snapcraft.io/ruby | ||
|
||
snap is the package system developed by Canonical. You can distribute the package with necessary libraries by using snap. It solved the problem that users can not use any versions of Ruby interpreter when using Linux distribution package system like rpm or apt. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
On Ubuntu 16.04 or later, you can use Ruby snap with the following command: | ||
|
||
sudo snap install ruby -classic | ||
|
||
(If you use other Linux distributions, please refer to https://docs.snapcraft.io/installing-snapd/6735) | ||
|
||
Our snap uses the "channel" feature to release multiple Ruby series concurrently. For example, without specifying a channel, 2.5.3 will be installed. But if you want to use Ruby 2.4, specify the 2.4 channel like the following: | ||
|
||
sudo snap install ruby --classic --channel=2.4/stable | ||
|
||
You can also use multiple channels. The following commands switch to Ruby 2.3: | ||
|
||
sudo snap switch ruby --channel=2.3/stable | ||
sudo snap refresh | ||
|
||
Our snap set `$HOME/.gem` to `GEM_HOME` and `GEM_PATH` environment variable. So if you want to execute commands installed by rubygems such as rails and rspec without using bundle exec, you have to add the following line to your shell rc files (like .bashrc): | ||
|
||
eval `ruby.env` | ||
|
||
Since `$HOME/.gem` is shared by multiple versions, if you switch versions and use them, you will need to recompile C extensions using the `gem pristin --extensions` command. | ||
|
||
The initial version of official Ruby snap has released during Snapcraft summit held at Canonical office in London on Nov 6-8th, 2018. Any feedbacks are welcomed at https://github.com/ruby/snap.ruby. | ||
|
||
Enjoy! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
layout: news_post | ||
title: The official ruby snap is available | ||
author: Hiroshi SHIBATA | ||
translator: | ||
date: 2018-11-08 14:58:28 +0000 | ||
lang: ja | ||
--- | ||
|
||
Ruby の公式 snap パッケージをリリースしました。 | ||
|
||
https://snapcraft.io/ruby | ||
|
||
snap は canonical が開発している新しいパッケージシステムです。独自のファイルシステムを利用して、バイナリの動作に必要なライブラリを全てパッケージングして配布することができます。snap を利用することで、 yum や apt のような Linux ディストリビューションのパッケージシステムを利用した時に、任意のバージョンをユーザーが自由に使うことができない問題を解決しました。 | ||
|
||
Ubuntu 16.04 以降のディストリビューションなら以下のコマンドで snap ruby を使うことができます。 | ||
|
||
sudo snap install ruby --classic | ||
|
||
Ubuntu 以外のディストリビューションで snap を利用する場合の準備については https://docs.snapcraft.io/installing-snapd/6735 を参照してください。 | ||
|
||
Ruby の snap パッケージは channel と呼ばれる機能を用いて、現在メンテナンスしているバージョンを配信しています。例えば、2018/11 現在 channel を指定しない場合は 2.5.3 がインストールされますが、2.4 を利用したい場合は以下のように指定します。 | ||
|
||
sudo snap install ruby --classic --channel=2.4/stable | ||
|
||
snap の機能を使うと複数の Ruby のバージョンを利用することができます。例えば、Ruby 2.3 に切り替えるには以下のコマンドを実行します。 | ||
|
||
sudo snap switch ruby --channel=2.3/stable | ||
sudo snap refresh | ||
|
||
また、snap の制限事項として、RubyGems は `$HOME/.gem` にインストールされるように GEM_HOME と GEM_PATH を設定しています。そのため、rails や rspec などのコマンドを `bundle exec` を用いずに実行したい場合は以下の行を `.bashrc` などに設定する必要があります。 | ||
|
||
eval `ruby.env` | ||
|
||
`$HOME/.gem` は複数のバージョンで共有されるため、バージョンを切り替えて利用した場合、C 拡張などは `gem pristine` コマンドを用いて再コンパイルする必要があります。 | ||
|
||
この ruby snap は 11/6-8 にロンドンの canonical オフィスで開催された snapcraft summit で初めて公式バージョンをリリースしました。不具合やフィードバックは https://github.com/ruby/snap.ruby で受け付けています。お楽しみください。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a proper location. Apt & Yum are (still) popular package managers, I think these two should be put on the top.