-
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
Conversation
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 think we need to update our "Installations" page as well.
en/news/_posts/2018-11-08-snap.md
Outdated
|
||
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. | ||
|
||
For Ubuntu 16.04 or later distribution, you can use Ruby snap with the following command. |
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.
On Ubuntu 16.04 or later, you can use Ruby snap with the following command:
en/news/_posts/2018-11-08-snap.md
Outdated
|
||
sudo snap install ruby -classic | ||
|
||
When you use the Linux distributions other than Ubuntu, Please refer to https://docs.snapcraft.io/installing-snapd/6735. |
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.
(If you use other Linux distributions, please refer to https://docs.snapcraft.io/installing-snapd/6735)
en/news/_posts/2018-11-08-snap.md
Outdated
|
||
When you use the Linux distributions other than Ubuntu, Please refer to https://docs.snapcraft.io/installing-snapd/6735. | ||
|
||
Ruby snap uses the feature called channel to distribute the currently maintained version. For example, if you do not specify a channel at 2018/11, It will be installed 2.5.3. but if you want to use Ruby 2.4, specify it as follows. |
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.
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:
en/news/_posts/2018-11-08-snap.md
Outdated
|
||
sudo snap install ruby --classic --channel=2.4/stable | ||
|
||
Multiple Ruby versions can be used with the snap feature. For example, to switch to Ruby 2.3, execute the following command. |
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.
You can also use multiple channels. The following commands switch to Ruby 2.3:
en/news/_posts/2018-11-08-snap.md
Outdated
sudo snap switch ruby --channel=2.3/stable | ||
sudo snap refresh | ||
|
||
The Ruby snap has set `$HOME/.gem` to `GEM_HOME` and `GEM_PATH` environmental variables. Therefore, if you want to execute commands such as rails and rspec without using `bundle exec`, you need to set the following lines to` .bashrc` and so on. |
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.
Our snap set
$HOME/.gem
toGEM_HOME
andGEM_PATH
environment variable. So if you want to execute commands installed by rubygems such asrails
andrspec
without usingbundle exec
, you have to add the following line to your shell rc files (like.bashrc
):
en/news/_posts/2018-11-08-snap.md
Outdated
|
||
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 pristine` command. |
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.
Is this true? I think extension library files should live under ~/.gem/extensions/x86_64-linux/$ABI
.
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.
It's true.
.gem
が共通だと、Ruby 2.3 でインストールした gem を 2.4 で使おうとして C extension だけ見つからないという挙動になるので pristine が必要、ということなんだけど、なんか伝わってないところあるかな。
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.
C extension だけ見つからないという挙動になるので pristine が必要
(Since the extension files (.so, .bundle) are only unshared between different Ruby ABI version (unlike .rb files,) this is true)
Understood, yes, I missed the normal .rb files are still shared between rubies. So:
Note that you may need to run
gem pristine
to build extension libraries when you switch to a different channel, since$HOME/.gem
is shared by multiple Ruby versions.
en/news/_posts/2018-11-08-snap.md
Outdated
|
||
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 pristine` command. | ||
|
||
This ruby snap released the official version for the first time with the snapcraft summit held at the canonical office in London on 6-8 Nov, 2018. The feedback are accepted at [https://github.com/ruby/snap.ruby](http://github.com/ruby/snap.ruby). Please enjoy. |
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.
We released the initial version of official Ruby snap 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!
@hsbt On the snap page, I would edit the copy from this:
To this:
See ruby-lang.org's description of Ruby for why I believe "scripting" is a bit of a reductive way of defining Ruby in 2018:
Comparing Ruby to Perl also seems a bit outdated and unnecessary. It's more likely that people who use an interpreted scripting language in 2018 are using Python rather than Perl if they're not already using Ruby. However it seems unlikely anyone using either Perl or Python would not be aware of Ruby by now, which is why I removed the parenthesis. Finally, contrasting the common usage of Ruby as a web development tool (in the first sentence) with its scripting abilities (in the second sentence) gives a much clearer picture of the wide array of use cases for it. |
@sorah Thanks! I applied your proofreadings. @olivierlacan I will update your suggestions when releasing next snaps. |
@@ -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) |
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.
snap (Linux)
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.
$ 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 comment
The reason will be displayed to describe this comment to others. Learn more.
We have several channels per Ruby minor series. For instance, the following commands switch to Ruby 2.3:
### 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Snap is a package manager developed by Canonical. It's available out-of-the-box on Ubuntu, but snap also works on many Linux distributions.
$ 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 comment
The reason will be displayed to describe this comment to others. Learn more.
?
en/news/_posts/2018-11-08-snap.md
Outdated
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Snap is a package system developed by Canonical. It allows you to distribute a software with its dependencies for many different Linux systems. This solves the problem that a user cannot install the latest Ruby release from the default repository of their system like in rpm or apt.
@sorah Thanks again, I applied your feedback. |
@hsbt The links aren't working and formatting is looking strange on https://www.ruby-lang.org/en/news/2018/11/08/snap/. Is something wrong with the Markdown maybe? Looks like you used 4-spaces for code blocks instead of Markdown triple backticks and auto-linking URLs isn't set up on the Markdown renderer. |
See ruby#1888 (comment) @hsbt, read your GitHub emails! :-p
See ruby#1888 (comment) @hsbt, read your GitHub emails! :-p
See ruby#1888 (comment) @hsbt, read your GitHub emails! :-p
Use improved description as suggested by Olivier Lacan (@olivierlacan), see ruby/www.ruby-lang.org#1888.
I wrote the announcement about the ruby snap package.
https://snapcraft.io/ruby
Can someone proofread them?