Jake Denison
Jake Denison

Reputation: 84

How To Remove Rails Installation From /usr/bin/rails

I'm trying to install Ruby on Rails on MacOS Mojave. Here's what I have so far:

ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]

rails -v
Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

which rails
usr/bin/rails

I've done some research on the issue and it looks like because I used sudo when I originally ran gem install rails, the rails executable got put in a location where it doesn't have access to the right libraries.

How do I fix this or remove the rails executable to start a fresh install from scratch?

Upvotes: 3

Views: 2393

Answers (1)

anothermh
anothermh

Reputation: 10546

Ignore the existing Rails installation in your system Ruby. Don't bother mucking about with any changes you've made to system Ruby and its gems. Just put it in the past and move on:

Install RVM with:

\curl -sSL https://get.rvm.io | bash -s stable

Restart your shell, then install Ruby with:

rvm install 2.6.5

Don't use system Ruby.

Then install Rails (without sudo, never use sudo with Ruby installed by RVM):

gem install rails

Upvotes: 2

Related Questions