Trying to install Dradis on Mac OS X Catalina gives me an error, “You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.”

0

I'm trying install Dradis in my Mac OS X Catalina

enter image description here

git clone https://github.com/dradis/dradis-ce.git
cd dradis-ce/
./bin/setup

I kept getting

You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.


and

Yes, I have Ruby installed

⚡️  dradis-ce  which ruby
/usr/bin/ruby
⚡️  dradis-ce  ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
⚡️  dradis-ce 

cyber8200

Posted 2020-02-18T15:35:05.170

Reputation: 217

"You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory." So give yourself write permission? – DavidPostill – 2020-02-18T15:40:41.323

I'm on a Mac, and logged in as admin as user : kyo – cyber8200 – 2020-02-18T15:41:37.377

That doesn't mean you have permission. What are the current permissions on that folder? – DavidPostill – 2020-02-18T15:42:39.760

See if adding eval "$(rbenv init -)" to the end of your ~/.bash_profile helps; source for this tip can be found here. Do that and close the terminal and open it up again and see if that clears things up. @DavidPostill Generally one doesn’t face such permission change issues for stuff like this. The issue is most likely the dradis-ce Ruby lib directory is not being checked before the system one is checked in /Library/Ruby/Gems/2.6.0.

– JakeGould – 2020-02-18T15:42:45.510

@JakeGould, now I can't run bundle install, I kept getting Your Ruby version is 2.6.3, but your Gemfile specified 2.4.1 – cyber8200 – 2020-02-18T15:44:31.033

@kyo Well, then undo that change! – JakeGould – 2020-02-18T15:48:20.900

Answers

0

I ran this

sudo chmod -R 777 /Library/Ruby/Gems/2.6.0

I can by pass that error now.

⚡️  dradis-ce  ./bin/setup 

== Enabling default add-ons ==
== Installing dependencies ==
Fetching bundler-2.1.4.gem
Successfully installed bundler-2.1.4
Parsing documentation for bundler-2.1.4
Installing ri documentation for bundler-2.1.4
Done installing documentation for bundler after 2 seconds
1 gem installed
Your Ruby version is 2.6.3, but your Gemfile specified 2.4.1
Your Ruby version is 2.6.3, but your Gemfile specified 2.4.1

== Command ["bundle install"] failed ==
⚡️  dradis-ce  

cyber8200

Posted 2020-02-18T15:35:05.170

Reputation: 217

chmod 777 is never a good idea even if it seems to “solve” things. If you run Ruby you don’t muck with system gems. Read up on the issue here; you most likely could solve the issue with a user-specific Ruby environment being setup for Dradis. – JakeGould – 2020-02-18T15:51:29.950

I’ll update to 644 then. – cyber8200 – 2020-02-18T15:58:15.067

644 is appropriate for files. For directories it should be 755. Directories will becoming inaccessible without the execution bit set which is the main difference between 644 and 755. – JakeGould – 2020-02-18T16:01:39.107

0

It seems that this issue could be fixed by installing your dependencies elsewhere.

$ cat ~/.bundle/config
---
BUNDLE_PATH: "vendor/bundle"

That way all my gems are installed in the same folder as the app.

$ cd dradis-ce/
$ ./bin/setup

Should result in bundler installing all gem dependencies in dradis-ce/vendor/bundle/

Daniel Martin

Posted 2020-02-18T15:35:05.170

Reputation: 1