error installing rails - alternate installation path possible

2 weeks ago 14
ARTICLE AD BOX

Your OS user apparently has no write privilege on

/var/lib/gems/3.2.0/gems/websocket-driver-0.8.0/CHANGELOG.md

In order to fix it, you need to grant your OS user the necessary privileges over /var/lib/gems/3.2.0 or do it with a user who has access there, like a sudoer:

sudo gem install rails

Lajos Arpad's user avatar

2 Comments

does not work as a sudoer. runs in another errors ..see post

2025-11-16T08:49:09.623Z+00:00

"This error indicates that during the installation of a gem, the build process for compiling native extensions (typically C or C++ code) failed. This often happens because the gem relies on system-level libraries and tools that are either missing or incorrectly configured on your machine." fastruby.io/blog/how-to-fix-gem-ext-error.html

2025-11-17T06:04:43.403Z+00:00

Often, a user might bump into permissions errors when trying to install gems on the same Ruby version that came installed on your OS. That version is usually "protected", it's meant to be used for common operations required by your system and you'd be better off avoiding to rely on it for your apps. Technically, you could do some workarounds, like sudoing the commands to force them to run, but it's not recommended to do so as you can end up messing up with basic configs.

The recommended way is to install Ruby through a package manager (such as Mise, as recommended the official docs link you shared in your original message).

By doing so, you'll install a Ruby version that's isolated from your OS and you should then have permissions to manipulate it as you wish.

lmtaq's user avatar

1 Comment

I'm not sure why this was down-voted. Mise is an excellent choice for managing the installation of many languages without conflicting with the OS-shipped version of Ruby, which you should ABSOLUTELY not touch if you don't know what you're doing (and probably even still shouldn't).

2025-11-19T05:42:37.483Z+00:00

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Read Entire Article