soylent / weblink

Use your web browser as a proxy server.
31 stars 2 forks source link

Install issue - "You don't have write permissions" #12

Open fsafq41 opened 12 months ago

fsafq41 commented 12 months ago

When trying to install on a mac apple silicon with a default ruby i obtain the following error message:

gem install weblink ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

Any reason, why weblink (and related packages) tries to install directly into the ruby directory? Note: i tried a sudo install (not recommended at all, of course) and got other errors also...

soylent commented 12 months ago

gem installs packages system-wide by default, which requires root permissions. I recommend using the --user-install flag to install gems in your home directory instead:

$ gem install --user-install weblink

It will install the gem in ~/.gem/ruby/2.6.0 (depending on your Ruby version), and you can run it as follows:

$ ~/.gem/ruby/2.6.0/bin/weblink

For convenience, you can add ~/.gem/ruby/2.6.0/bin/ to your PATH.

fsafq41 commented 11 months ago

Thank you. The instructions above made the trick to bypass the previous error message. However, I am now having another error.

ERROR: Error installing weblink: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20231111-25447-1en0m7n.rb extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

soylent commented 11 months ago

Looks like you need to install Command Line Developer tools first:

$ xcode-select --install