Skip to content

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

Merged
merged 7 commits into from
Nov 28, 2018
Merged

The announcement for snap release. #1888

merged 7 commits into from
Nov 28, 2018

Conversation

hsbt
Copy link
Member

@hsbt hsbt commented Nov 21, 2018

I wrote the announcement about the ruby snap package.

https://snapcraft.io/ruby

Can someone proofread them?

@hsbt hsbt requested review from a team as code owners November 21, 2018 03:42
@hsbt hsbt changed the title The announcement for The announcement for snap release. Nov 21, 2018
Copy link
Member

@sorah sorah left a 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.


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.
Copy link
Member

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:


    sudo snap install ruby -classic

When you use the Linux distributions other than Ubuntu, Please refer to https://docs.snapcraft.io/installing-snapd/6735.
Copy link
Member

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)


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.
Copy link
Member

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:


    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.
Copy link
Member

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:

    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.
Copy link
Member

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 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 pristine` command.
Copy link
Member

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.

Copy link
Member Author

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 が必要、ということなんだけど、なんか伝わってないところあるかな。

Copy link
Member

@sorah sorah Nov 23, 2018

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.


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.
Copy link
Member

@sorah sorah Nov 21, 2018

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!

@olivierlacan
Copy link
Contributor

@hsbt On the snap page, I would edit the copy from this:

Interpreter of object-oriented scripting language Ruby

Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in perl). It is simple, straight-forward, and extensible.

To this:

Interpreter for the Ruby programming language

Ruby is an interpreted object-oriented programming language often used for web development. It also offers many scripting features to process plain text and serialized files, or manage system tasks. It is simple, straightforward, and extensible.

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:

A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.

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.

@hsbt
Copy link
Member Author

hsbt commented Nov 22, 2018

@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)
Copy link
Member

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:
Copy link
Member

@sorah sorah Nov 23, 2018

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.
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?


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.
Copy link
Member

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.

@hsbt
Copy link
Member Author

hsbt commented Nov 23, 2018

@sorah Thanks again, I applied your feedback.

@hsbt hsbt merged commit ed6c059 into master Nov 28, 2018
@hsbt hsbt deleted the snap branch November 28, 2018 09:27
@olivierlacan
Copy link
Contributor

@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.

olivierlacan added a commit to olivierlacan/www.ruby-lang.org that referenced this pull request Dec 4, 2018
See ruby#1888 (comment)

@hsbt, read your GitHub emails! :-p
olivierlacan added a commit to olivierlacan/www.ruby-lang.org that referenced this pull request Dec 4, 2018
See ruby#1888 (comment)

@hsbt, read your GitHub emails! :-p
olivierlacan added a commit to olivierlacan/www.ruby-lang.org that referenced this pull request Dec 4, 2018
See ruby#1888 (comment)

@hsbt, read your GitHub emails! :-p
matzbot pushed a commit to ruby/ruby that referenced this pull request May 5, 2019
Use improved description as suggested by Olivier Lacan (@olivierlacan),
see ruby/www.ruby-lang.org#1888.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants