Re:VIEW のバージョンアップ

# gem update review でアップデート
### 概要
ReVIEW 5.10.0にアップデートするために、gem update review を実行しても、ERRORになってしまう。
rubyを3.2.6にアップデートすると、gem list で表示されると、ReVIEWが無くなってしまうが、gem update reviewを実行したら、インストールできました。

### 手順
gem update review を実行しても、ERRORですね。
```shell
macuser@Mac-mini attiny85 % gem update review            
Updating installed gems
Updating review
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
macuser@Mac-mini attiny85 % 
```

gemとは、RubyGems（Rubyのパッケージ管理ツール）のコマンド

sudo gem update review で実行しても
ERRORがでますね。
```shell
macuser@Mac-mini attiny85 % sudo gem update review
Password:
Updating installed gems
Updating review
Building native extensions. This could take a while...
ERROR:  Error installing review:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20250112-9384-1d2r45u.rb extconf.rb
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
make "DESTDIR="
make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin24/ruby/config.h', needed by `nkf.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-24/2.6.0/nkf-0.2.0/gem_make.out
Gems updated: nkf
Gems already up-to-date: review
macuser@Mac-mini attiny85 % 
```

Failed to build gem native extension エラーは、Gemをインストール中にネイティブの拡張機能（CやC++で書かれたコード）のビルドが失敗したときに発生します。これは主に以下の原因によるものです。

よくわからないけど、sudo gem install nkf　を実行
ERRORですね。
```shell
macuser@Mac-mini attiny85 % sudo gem install nkf
Password:
Building native extensions. This could take a while...
ERROR:  Error installing nkf:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20250112-9648-a2xggg.rb extconf.rb
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
make "DESTDIR="
make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin24/ruby/config.h', needed by `nkf.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-24/2.6.0/nkf-0.2.0/gem_make.out
macuser@Mac-mini attiny85 % 
```
ruby のバージョンは？
ruby -v　2.6.10　らしい。
ふるいのかな。
```shell
macuser@Mac-mini attiny85 % ruby -v
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin24]
macuser@Mac-mini attiny85 % 
```

rbenv install -l rubyのバージョンを確認
```shell
macuser@Mac-mini attiny85 % rbenv install -l
3.1.6
3.2.6
3.3.6
3.4.1
jruby-9.4.9.0
mruby-3.3.0
picoruby-3.0.0
truffleruby-24.1.1
truffleruby+graalvm-24.1.1

Only latest stable releases for each Ruby implementation are shown.
Use `rbenv install --list-all' to show all local versions.
macuser@Mac-mini attiny85 % 
```
rbenv install 3.4.1 で、Ruby Version 3.4.1 にアップデートしてみる。
<font color="Red">BUILD FAILED</font> になっていますね。
```shell
macuser@Mac-mini attiny85 % rbenv install 3.4.1   
ruby-build: using openssl@3 from homebrew
==> Downloading ruby-3.4.1.tar.gz...
-> curl -q -fL -o ruby-3.4.1.tar.gz https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.1.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22.0M  100 22.0M    0     0  17.8M      0  0:00:01  0:00:01 --:--:-- 17.8M
==> Installing ruby-3.4.1...
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
-> ./configure "--prefix=$HOME/.rbenv/versions/3.4.1" --with-openssl-dir=/opt/homebrew/opt/openssl@3 --enable-shared --with-libyaml-dir=/opt/homebrew/opt/libyaml --with-gmp-dir=/opt/homebrew/opt/gmp --with-ext=openssl,psych,+
-> make -j 10

BUILD FAILED (macOS 15.1.1 on arm64 using ruby-build 20241225.2)

You can inspect the build directory at /var/folders/j9/9tgfvdwj7n7d1fct13q2nmfw0000gn/T/ruby-build.20250112174352.9953.wqxxFX
See the full build log at /var/folders/j9/9tgfvdwj7n7d1fct13q2nmfw0000gn/T/ruby-build.20250112174352.9953.log
macuser@Mac-mini attiny85 % 
```
一旦、rbenv install 3.2.6 で、Ruby Version 3.2.6 にアップデートしてみる。
うまく通りました。
```shell
macuser@Mac-mini attiny85 % rbenv install 3.2.6 
ruby-build: using openssl@3 from homebrew
==> Downloading ruby-3.2.6.tar.gz...
-> curl -q -fL -o ruby-3.2.6.tar.gz https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.6.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19.5M  100 19.5M    0     0   9.9M      0  0:00:01  0:00:01 --:--:--  9.9M
==> Installing ruby-3.2.6...
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
-> ./configure "--prefix=$HOME/.rbenv/versions/3.2.6" --with-openssl-dir=/opt/homebrew/opt/openssl@3 --enable-shared --with-readline-dir=/opt/homebrew/opt/readline --with-libyaml-dir=/opt/homebrew/opt/libyaml --with-gmp-dir=/opt/homebrew/opt/gmp --with-ext=openssl,psych,+
-> make -j 10
-> make install
==> Installed ruby-3.2.6 to /Users/macuser/.rbenv/versions/3.2.6

NOTE: to activate this Ruby version as the new default, run: rbenv global 3.2.6
macuser@Mac-mini attiny85 % 
```
ReVIEWをアップデートしてみましょう。
errorですね
```shell
macuser@Mac-mini attiny85 % sudo gem update review
Password:
Updating installed gems
Updating review
Building native extensions. This could take a while...
ERROR:  Error installing review:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20250112-50808-1e541z4.rb extconf.rb
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0/ext/nkf
make "DESTDIR="
make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin24/ruby/config.h', needed by `nkf.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/nkf-0.2.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-24/2.6.0/nkf-0.2.0/gem_make.out
Gems updated: nkf
Gems already up-to-date: review
macuser@Mac-mini attiny85 % 
```
Rubyのバージョンを切り替えます。
```
macuser@Mac-mini attiny85 % ruby -v            
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin24]
macuser@Mac-mini attiny85 % rbenv versions
* system
  3.2.6
macuser@Mac-mini attiny85 % rbenv global 3.2.6 
macuser@Mac-mini attiny85 % ruby -v           
ruby 3.2.6 (2024-10-30 revision 63aeb018eb) [arm64-darwin24]
macuser@Mac-mini attiny85 % 
```
reviewがないだと？
・・・たしかに。
```
macuser@Mac-mini attiny85 % sudo gem update review
Password:
Updating installed gems
Nothing to update
Gems not currently installed: review
macuser@Mac-mini attiny85 % gem list

*** LOCAL GEMS ***

abbrev (default: 0.1.1)
base64 (default: 0.1.1)
resolv-replace (default: 0.1.1)
rexml (3.3.9)
```

review をインストール
```console
macuser@Mac-mini attiny85 % gem install review    
Fetching image_size-3.4.0.gem
Fetching tty-color-0.6.0.gem
Fetching review-5.10.0.gem
Fetching pastel-0.8.0.gem
Fetching tty-logger-0.6.0.gem
Fetching rubyzip-2.4.1.gem
Fetching rouge-4.5.1.gem
Successfully installed tty-color-0.6.0
Successfully installed pastel-0.8.0
Successfully installed tty-logger-0.6.0
RubyZip 3.0 is coming!
**********************

The public API of some Rubyzip classes has been modernized to use named
parameters for optional arguments. Please check your usage of the
following classes:
  * `Zip::File`
  * `Zip::Entry`
  * `Zip::InputStream`
  * `Zip::OutputStream`
  * `Zip::DOSTime`

Run your test suite with the `RUBYZIP_V3_API_WARN` environment
variable set to see warnings about usage of the old API. This will
help you to identify any changes that you need to make to your code.
See https://github.com/rubyzip/rubyzip/wiki/Updating-to-version-3.x for
more information.

Please ensure that your Gemfiles and .gemspecs are suitably restrictive
to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0).
See https://github.com/rubyzip/rubyzip for details. The Changelog also
lists other enhancements and bugfixes that have been implemented since
version 2.3.0.
Successfully installed rubyzip-2.4.1
Successfully installed rouge-4.5.1
Successfully installed image_size-3.4.0
Successfully installed review-5.10.0
Parsing documentation for tty-color-0.6.0
Installing ri documentation for tty-color-0.6.0
Parsing documentation for pastel-0.8.0
Installing ri documentation for pastel-0.8.0
Parsing documentation for tty-logger-0.6.0
Installing ri documentation for tty-logger-0.6.0
Parsing documentation for rubyzip-2.4.1
Installing ri documentation for rubyzip-2.4.1
Parsing documentation for rouge-4.5.1
Installing ri documentation for rouge-4.5.1
Parsing documentation for image_size-3.4.0
Installing ri documentation for image_size-3.4.0
Parsing documentation for review-5.10.0
Installing ri documentation for review-5.10.0
Done installing documentation for tty-color, pastel, tty-logger, rubyzip, rouge, image_size, review after 5 seconds
7 gems installed

A new release of RubyGems is available: 3.4.19 → 3.6.2!
Run `gem update --system 3.6.2` to update your installation.

macuser@Mac-mini ~ % review version        
5.10.0
```