Installation Problems - Permissions error with sudo

I’m been going round in circles for days trying to install Jekyll. I’d be very grateful if someone could help me!

At first I was having problems with the Rust dependency.

==> Installing ruby dependency: rust
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences.

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 12.4.

==> ./configure --prefix=/usr/local/Cellar/rust/1.68.2 --enable-vendor --set rus
==> make

At this stage my CPU usage would goto 100% and nothing would happen so I had to terminate the process.

After playing aroudn with a few other guides, now I can’t even get that far, with:

sudo gem install jekyll

Giving

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.
	/Library/Ruby/Site/2.6.0/rubygems/installer.rb:712:in `verify_gem_home'
	/Library/Ruby/Site/2.6.0/rubygems/installer.rb:902:in `pre_install_checks'
	/Library/Ruby/Site/2.6.0/rubygems/installer.rb:302:in `install'
	/Library/Ruby/Site/2.6.0/rubygems/resolver/specification.rb:104:in `install'
	/Library/Ruby/Site/2.6.0/rubygems/request_set.rb:194:in `block in install'
	/Library/Ruby/Site/2.6.0/rubygems/request_set.rb:182:in `each'
	/Library/Ruby/Site/2.6.0/rubygems/request_set.rb:182:in `install'
	/Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:214:in `install_gem'
	/Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:230:in `block in install_gems'
	/Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:223:in `each'
	/Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:223:in `install_gems'
	/Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:169:in `execute'
	/Library/Ruby/Site/2.6.0/rubygems/command.rb:327:in `invoke_with_build_args'
	/Library/Ruby/Site/2.6.0/rubygems/command_manager.rb:252:in `invoke_command'
	/Library/Ruby/Site/2.6.0/rubygems/command_manager.rb:192:in `process_args'
	/Library/Ruby/Site/2.6.0/rubygems/command_manager.rb:150:in `run'
	/Library/Ruby/Site/2.6.0/rubygems/gem_runner.rb:51:in `run'
	/usr/bin/gem:21:in `<main>'

Does anyone know how I can fix this? Thank you.

1 Like

Please share your linux distro.

Have you tried following the official documentation for Ruby or Jekyll installation for your distro ?

@SamIsStuck I have been getting exactly the same error, for three days now. I would appreciate if someone can help us figure out the problem.

1 Like

Hi, thanks for the reply!

I’m using OSX 10.15.5

I worked through the instructions on the Jekyll website. When Homebrew started installing the Rust package(s) it would get “stuck” with the CPU maxing out.

Installing Jekyll using “sudo gem install jekyll” gave the error from my first post.

If you have any thoughts I’d be grateful!

Have you tried uninstalling Ruby and re-installing it?

I’m not a Mac user, seems like it comes with its own ruby already installed and people seem to have issues for some reason.

If you search you’ll find this SO post that seems helpful - but again I am not a Mac use so I don’t understand what it is asking you to do.

You should not be installing gems with sudo.

Jekyll should be installed as non-root user. Even here it has no mention of sudo for installing Jekyll.

Only install ruby with sudo since it is a language. Jekyll is a ruby gem which doesn’t require sudo. You should be able to install it without sudo.

Does a simple ( without sudo ) gem command works for you ?

1 Like

That seems to work! I think the problem was when configuring the shell, I had configured for zhsc rather than Bash.

Thanks!