LoginSignup
1
1

More than 5 years have passed since last update.

Windows10のWSLでRubyとRuby on Railsをアンインストールする

Posted at

WSL(Windows Subsystem for Linux)にインストールしたRubyとRuby on Railsをアンインストールする手順です。

環境

  • Windows 10 Home (ver.1803)
  • Ubuntu 18.04
  • ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux](rbenv経由でインストール)
  • Rails 5.2.2

Ruby on Railsのアンインストール

まずはインストールされているRailsのバージョンを確認します。
-vオプションを付けてrailsコマンドを実行します。


shuhey@HelloWorld:~$ rails -v
Rails 5.2.2

次にアンインストールですが、アンインストールはgem uninstall rails -v 5.2.2ではなく、gem uninstall railties -v 5.2.2とします。

shuhey@HelloWorld:~$ gem uninstall railties -v 5.2.2

You have requested to uninstall the gem:
        railties-5.2.2

coffee-rails-4.2.2 depends on railties (>= 4.0.0)
rails-5.2.2 depends on railties (= 5.2.2)
sass-rails-5.0.7 depends on railties (< 6, >= 4.0.0)
sprockets-rails-3.2.1 depends on railties (>= 4.0, development)
web-console-3.7.0 depends on railties (>= 5.0)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y
Remove executables:
        rails

in addition to the gem? [Yn]  y
Removing rails
Successfully uninstalled railties-5.2.2

これでRuby on Railsのアンインストールが完了です。

Rubyのアンインストール

rbenvを使ってインストールしてある場合です。
rubyのバージョンを調べます。

shuhey@HelloWorld:~$ ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]

rbenvuninstallコマンドを使ってrubyをアンインストールします。
上で調べたバージョンは2.5.3p105ですが、ここで指定するバージョンは2.5.3だけでOKです。

shuhey@HelloWorld:~$ rbenv uninstall 2.5.3
rbenv: remove /home/shuhey/.rbenv/versions/2.5.3? [yN] y

これでRubyのアンインストールが完了です。

1
1
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1