Skip to content

Commit 9f0dd8f

Browse files
havenwoodJuanitoFatas
authored andcommitted
Fix code snippets in snap post (en, ja) (#1899)
* Switch to markdown style code blocks * Fix a couple single-character typos
1 parent 8f90080 commit 9f0dd8f

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

en/news/_posts/2018-11-08-snap.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,32 @@ Snap is a package system developed by Canonical. It allows you to distribute a s
1515

1616
On Ubuntu 16.04 or later, you can use Ruby snap with the following command:
1717

18-
    sudo snap install ruby -classic
18+
```
19+
sudo snap install ruby --classic
20+
```
1921

2022
(If you use other Linux distributions, please refer to https://docs.snapcraft.io/installing-snapd/6735)
2123

2224
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:
2325

24-
    sudo snap install ruby --classic --channel=2.4/stable
26+
```
27+
sudo snap install ruby --classic --channel=2.4/stable
28+
```
2529

2630
You can also use multiple channels. The following commands switch to Ruby 2.3:
2731

28-
    sudo snap switch ruby --channel=2.3/stable
29-
    sudo snap refresh
32+
```
33+
sudo snap switch ruby --channel=2.3/stable
34+
sudo snap refresh
35+
```
3036

3137
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):
3238

33-
    eval `ruby.env`
39+
```
40+
eval `ruby.env`
41+
```
3442

35-
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.
43+
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 --extensions` command.
3644

3745
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.
3846

ja/news/_posts/2018-11-08-snap.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,31 @@ snap は canonical が開発している新しいパッケージシステムで
1515

1616
Ubuntu 16.04 以降のディストリビューションなら以下のコマンドで snap ruby を使うことができます。
1717

18-
sudo snap install ruby --classic
18+
```
19+
sudo snap install ruby --classic
20+
```
1921

2022
Ubuntu 以外のディストリビューションで snap を利用する場合の準備については https://docs.snapcraft.io/installing-snapd/6735 を参照してください。
2123

2224
Ruby の snap パッケージは channel と呼ばれる機能を用いて、現在メンテナンスしているバージョンを配信しています。例えば、2018/11 現在 channel を指定しない場合は 2.5.3 がインストールされますが、2.4 を利用したい場合は以下のように指定します。
2325

24-
sudo snap install ruby --classic --channel=2.4/stable
26+
```
27+
sudo snap install ruby --classic --channel=2.4/stable
28+
```
2529

2630
snap の機能を使うと複数の Ruby のバージョンを利用することができます。例えば、Ruby 2.3 に切り替えるには以下のコマンドを実行します。
2731

28-
sudo snap switch ruby --channel=2.3/stable
29-
sudo snap refresh
32+
```
33+
sudo snap switch ruby --channel=2.3/stable
34+
sudo snap refresh
35+
```
3036

3137
また、snap の制限事項として、RubyGems は `$HOME/.gem` にインストールされるように GEM_HOME と GEM_PATH を設定しています。そのため、rails や rspec などのコマンドを `bundle exec` を用いずに実行したい場合は以下の行を `.bashrc` などに設定する必要があります。
3238

33-
eval `ruby.env`
39+
```
40+
eval `ruby.env`
41+
```
3442

35-
`$HOME/.gem` は複数のバージョンで共有されるため、バージョンを切り替えて利用した場合、C 拡張などは `gem pristin --extensions` コマンドを用いて再コンパイルする必要があります。
43+
`$HOME/.gem` は複数のバージョンで共有されるため、バージョンを切り替えて利用した場合、C 拡張などは `gem pristine --extensions` コマンドを用いて再コンパイルする必要があります。
3644

3745
この ruby snap は 11/6-8 にロンドンの canonical オフィスで開催された snapcraft summit で初めて公式バージョンをリリースしました。不具合やフィードバックは https://github.com/ruby/snap.ruby で受け付けています。お楽しみください。

0 commit comments

Comments
 (0)