1

As someone brand new to programming, I am attempting to install Ruby using homebrew. The installation keeps getting stuck at the 'openssl' stage. This appears to be down to permissions on the directory:

/usr/local/etc/openssl/ 

Research on here and elsewhere online has pointed to attempting to install 'openssl' separately via Homebrew, which I have done and ended with the error:

==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2e.yosemite.bot Already downloaded: /Library/Caches/Homebrew/openssl-1.0.2e.yosemite.bottle.tar.gz ==> Pouring openssl-1.0.2e.yosemite.bottle.tar.gz Error: Permission denied - /usr/local/etc/openssl/certs Warning: Bottle installation failed: building from source. ==> Downloading https://www.openssl.org/source/openssl-1.0.2e.tar.gz Already downloaded: /Library/Caches/Homebrew/openssl-1.0.2e.tar.gz ==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2e --openssldir=/usr ==> make depend ==> make ==> make test ==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2e/share/man MANSUFFIX=ssl Last 15 lines from /Users/Joe/Library/Logs/Homebrew/openssl/05.make: SSL_want_read.3ssl => SSL_want.3ssl SSL_want_write.3ssl => SSL_want.3ssl SSL_want_x509_lookup.3ssl => SSL_want.3ssl installing man3/SSL_write.3ssl installing man3/d2i_SSL_SESSION.3ssl i2d_SSL_SESSION.3ssl => d2i_SSL_SESSION.3ssl installing man3/ssl.3ssl Cannot create directory /usr/local/etc/openssl/certs: Permission denied created directory `/usr/local/Cellar/openssl/1.0.2e/bin' created directory `/usr/local/Cellar/openssl/1.0.2e/lib' created directory `/usr/local/Cellar/openssl/1.0.2e/lib/engines' created directory `/usr/local/Cellar/openssl/1.0.2e/lib/pkgconfig' created directory `/usr/local/Cellar/openssl/1.0.2e/include' created directory `/usr/local/Cellar/openssl/1.0.2e/include/openssl' make: *** [install_sw] Error 13 

So I used 'chown' to change the ownership of the /openssl/ directory and managed to get a little further but am now stuck with this error:

==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2e.yosemite.bot Already downloaded: /Library/Caches/Homebrew/openssl-1.0.2e.yosemite.bottle.tar.gz ==> Pouring openssl-1.0.2e.yosemite.bottle.tar.gz Error: Permission denied - /usr/local/etc/openssl/misc/c_hash Warning: Bottle installation failed: building from source. ==> Downloading https://www.openssl.org/source/openssl-1.0.2e.tar.gz Already downloaded: /Library/Caches/Homebrew/openssl-1.0.2e.tar.gz ==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2e --openssldir=/usr ==> make depend ==> make ==> make test ==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2e/share/man MANSUFFIX=ssl Last 15 lines from /Users/Joe/Library/Logs/Homebrew/openssl/05.make: *DSO_WIN32*) sfx="eay32.dll"; pfx=;; \ *) sfx=".bad";; \ esac; \ cp ${pfx}gost$sfx /usr/local/Cellar/openssl/1.0.2e/lib/engines/${pfx}gost$sfx.new; \ fi; \ chmod 555 /usr/local/Cellar/openssl/1.0.2e/lib/engines/${pfx}gost$sfx.new; \ mv -f /usr/local/Cellar/openssl/1.0.2e/lib/engines/${pfx}gost$sfx.new /usr/local/Cellar/openssl/1.0.2e/lib/engines/${pfx}gost$sfx; \ fi installing gost making install in apps... installing openssl installing CA.sh cp: /usr/local/etc/openssl/misc/CA.sh.new: Permission denied make[1]: *** [install] Error 1 make: *** [install_sw] Error 1 

Again, to do with permissions on things in the openssl folder?

Does anyone know how to change this?

I guess the thing that has confused me MOST of all though is that I am the ONLY user on this computer and therefore the only admin as well, so I cannot get my head around why I would not have permission to access anything?

Two other things I have tried:

  • Using sudo before my command
  • Full reinstall of the OS X

Thanks for any help in advance.

4
  • 1
    Try putting "sudo" in front of your command. Commented Dec 9, 2015 at 23:04
  • Thanks Mike, this did actually pop up whilst I was looking about this site earlier and I tried it, my terminal just tells me I am cowardly, then refuses to do it? Commented Dec 9, 2015 at 23:10
  • 1
    Apparently that is because brew must be owned by root in order to run it as root. See this stackoverflow.com/questions/19039404/… Commented Dec 9, 2015 at 23:15
  • Thanks Mike, i am working my way through that now. Commented Dec 9, 2015 at 23:26

1 Answer 1

7

Simply being the only admin user on the machine does not mean that all the commands you run with that user will be run with root privilege. There is a still a separate root user inside the machine even though you don't get a GUI login for it. That would be a security risk and it also helps prevent you from accidentally hanging yourself by running a destructive command without slapping sudo in front of it.

You have two choices to resolve the issue:

  1. Adjust the permission of every directory that installer needs (in this case /usr/local/etc/openssl/misc). Looks like it needs write permission based on the error. But there may be many more directories once you get past that specific error.

You can make it fully open like this:

chmod -R 777 /usr/local/etc/openssl/misc 

or chown everything to yourself:

chown -R "$USER":admin /usr/local 
  1. Run brew as the root user (or with root privilege via sudo). This will require you to chown the brew executable to root instead of your user.
Sign up to request clarification or add additional context in comments.

2 Comments

I've tried changing the ownership of brew to the root user and had no success, beginning option 1. I maybe some time!
Mike, thank you for your help! That was the only directory that needed changing, its now all done!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.