Techioz Blog

ラックをラックアップで上書きする必要がありますか?

概要

Rails の最新バージョンに更新しようとすると、次のエラーが表示されます。

➜  ~ gem update rails
Updating installed gems
Updating rails
rackup's executable "rackup" conflicts with rack
Overwrite the executable? [yN]  
ERROR:  Error installing rails:
    "rackup" from rackup conflicts with installed executable from rack

ラックをラックアップに置き換える必要がありますか?

システム情報

➜  ~ ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]

➜  ~ rails --version
Rails 7.0.8

➜  ~ sw_vers -productVersion 
14.1

➜  ~ uname -v
Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:45 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6020

解決策

Ubuntu 23.10 インストールでも同じ問題が発生しました。あなたの質問に対するコメントを読んだ後、レールのインストールを中断し、ラックアップ gem をインストールしました。新しいシェルを開いて gem インストール レールを再実行すると、問題なく完了しました。

$ gem install rackup
rackup's executable "rackup" conflicts with rack
Overwrite the executable? [yN]  y
Successfully installed rackup-2.1.0
Parsing documentation for rackup-2.1.0
Installing ri documentation for rackup-2.1.0
Done installing documentation for rackup after 0 seconds
1 gem installed
NOTE:
A new release of RubyGems is available: 3.4.14 → 3.4.22!
Run `gem update --system 3.4.22` to update your installation.

$ gem update --system 3.4.22
. . .
$ gem install rails
. . .
$ rails -v 
Rails 7.1.2