1. The Rogue Gem Mac Os X
  2. The Rogue Gem Mac Os 7
  3. The Rogue Gem Mac Os Download
  4. Rogue Gem Guide
  5. The Rogue Gem Mac Os Download

Problem

After upgrading to Mac OS Big Sur, I saw this error I haven’t seen before:

After this I was able to install the rails gem successfully (without needing to do sudo) Solution no. 10: I run into a similar problem on my Mac while trying to install watchr package. ERROR: While executing gem (Gem::FilePermissionError) Somehow running sudo every time I need to install a package felt excessive. And with a specific version: brew gem install heroku 3.8.3 -homebrew-ruby. To upgrade: brew gem upgrade heroku. To uninstall: brew gem uninstall heroku. To check information: brew gem info heroku. Note: Installed gems are listed in brew list with prefix of gem-, like gem-heroku.

So I ran bundle install but it didn’t seem to work either. An excerpt from the terminal output:

Solution

After some research and trial and error, I found this precious answer in Stack Overflow that it is due to the Ruby version that is not compatible with BigSur and it should be at least 2.7. So Ichecked Ruby releases and decided to go with one of the most recent releases: 2.7.2.

Anyway, steps I think worked:

  1. Check Ruby version
  2. Install Ruby Version Manager (rvm)
  3. Install 2.7.2 version using rvm
  4. Check Ruby version again
  5. Bundle install
  6. Run bundle

And it worked!

Some other things I tried

  1. Installing Ruby through Homebrew: didn’t solve the issue but I don’t know if this actually and eventually helped or not.

  2. Installing the latest version of Ruby (ref) using rvm: didn’t update the version for some reason.

Question or issue on macOS:

I have checked all the other similar answers and none was exactly like mine, neither did any of those solutions work for me.

gem environment and sudo gem environment give the same result:

rvm -v : rvm 1.22.3

ruby -v : ruby 1.8.7

OSX 10.8.4

echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/ava/.rvm/bin:/home/ava/bin

gem install gives

whereas I am able to install the same via sudo. What am I doing wrong?

UPDATE:

The Rogue Gem Mac OS

As per comments and this post, I ran following:

rvm implode and then re installed the stable version.
rvm install 1.9.3 or any other ruby installation fails with

make.log

How to solve this problem?

Solution no. 1:

To resolve the error:

The Rogue Gem Mac Os X


ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions into the /usr/local/lib/ruby/gems/1.8 directory.

the following solution worked for me:

Solution no. 2:


ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

  1. Install RVM
  2. Set the gem folder in your shell resource file. I.e. .zshrc, .bashrc etc
  1. Install you gem gem i LIBRARY_NAME

Solution no. 3:

Your global (system-wide) config file probably has the --no-user-install flag set. Create/edit your local ~/.gemrc file and append the following line(s):

Note
The actual directory for the gemdir option will vary depending on your system/desire; it may or may not be needed, but it’s probably better to designate the desired installation directory within your home folder (gemdir) than to assume it’ll be taken care of by itself.

The ArchLinux Wiki has some useful/well-organized information pertaining to this.

chruby

Alternatively, similar to the rvm solution already suggested, you can try using chruby to maintain, configure, and use local versions of ruby. To install additional versions of ruby, however, you need to use ruby-install.

From the project’s README:


Changes the current Ruby. Features
Updates $PATH.
Also adds RubyGems bin/ directories to $PATH.
Correctly sets $GEM_HOME and $GEM_PATH.
Users: gems are installed into ~/.gem/$ruby/$version.
Root: gems are installed directly into /path/to/$ruby/$gemdir.
Additionally sets $RUBY_ROOT, $RUBY_ENGINE, $RUBY_VERSION and $GEM_ROOT.
Optionally sets $RUBYOPT if second argument is given.
Calls hash -r to clear the command-lookup hash-table.
Fuzzy matching of Rubies by name.
Defaults to the system Ruby.
Optionally supports auto-switching and the .ruby-version file.
Supports bash and zsh.
Small (~100 LOC).
Has tests.

Anti-Features
Does not hook cd.
Does not install executable shims.
Does not require Rubies be installed into your home directory.
Does not automatically switch Rubies by default.
Does not require write-access to the Ruby directory in order to install gems.

The Rogue Gem Mac Os 7

Requirements
bash >= 3 or zsh

Solution no. 4:

If you have installed rvm as the root user, then you must sudo to install anything.

You can install rvm in user-mode as a regular user, in which case everything is stored in your home directory and no sudo is required.

If you are not committed to this particular install, type sudo rvm implode and start over.

The Rogue Gem Mac OS

Solution no. 5:

assuming that rvm is installed you could do something like:

No need to do sudo.

Solution no. 6:

If you have installed rbenv & facing this error, below answer will help (this is how it worked for me)

Issue:

DO NOT USE SUDO

  1. check the rbenv versions

The Rogue Gem Mac Os Download

Here, you can see, by default it selected system. change it to your ruby version.

Rogue Gem Guide

Then try installing the bundler, it will work:

Solution no. 7:

You probably don’t have write permissions to somewhere along that path, (most likely /usr/local/lib), you need to change the location of your RVM storage in order to not need sudo

Solution no. 8:

Be aware that if you chose to perform a multi-user install of rvm, you must add each user to the rvm group via

Relevant info from rvm’s FAQ

Solution no. 9:

I encountered the same error yesterday when I tried to install rails using following command.

Prior to this I had installed Ruby Environment Manager (rbenv), but the following command failed to add the if-eval to bash profile.

So, I looked into this and found out that the current directory reference – was the problem for the above command to fail. I changed it to ~ and successfully ran the below command

After this I was able to install the rails gem successfully (without needing to do sudo)

Solution no. 10:

I run into a similar problem on my Mac while trying to install watchr package


ERROR: While executing gem … (Gem::FilePermissionError)

The Rogue Gem Mac Os Download

Somehow running sudo every time I need to install a package felt excessive. I have rbenv installed so I set global ruby version like this

Then simply installed the package I wanted. In my case the command is

Hope this helps!