Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Ben Attenborough
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Ben Attenborough
Front End Web Development Techdegree Graduate 32,769 Points

El Capitan changes affecting web developers

Hi all, I just wanted to warn Mac people thinking of upgrading to El Capitan that the upgrade can affect web development.

One of the biggies I've come across is problems installing Ruby gems such as sass. The command:

gem install sass

Can throw the following error under El Capitan:

ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/sass

I believe El Capitan reserves the folder /usr/bin and prevents things being installed in there. The workaround which works for me is to tell gem to install to a local folder, as follows:

gem install -n /usr/local/bin GEM_NAME_HERE

There's more on the topic here: https://github.com/sass/sass/issues/1768

Has anyone else encountered this problem? What is the best workaround / practice?

1 Answer

rydavim
rydavim
18,814 Points

Basically, El Capitan nerfed root access, which in turn gummed up stuff for developers. I ended up doing some research and the following steps fixed my problems with El Capitan's Systems Integrity Protection.

Disable Systems Integrity Protection:

  1. Reboot holding Cmd + R to get into recovery mode.
  2. Bring up a terminal from the dropdown menu.
  3. Run csrutil disable to disable Systems Integrity Protection.
  4. Reboot as normal and log back into OSX.

Great! Now you can go about fixing your permissions.

sudo chflags norestricted /usr/local && sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local

That will fix your permissions back to what most developer utilities are expecting. It should also let you make modifications even if you turn Systems Integrity Protection back on.

You may also need to re-install the xcode developer tools.

xcode-select --install

If you want to, you can now reboot into recovery mode again and turn Systems Integrity Protection back on.

Ben Attenborough
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Ben Attenborough
Front End Web Development Techdegree Graduate 32,769 Points

Hmmm, should we really be disabling system integrity protection? Is that really what Apple wants developers to do? It's not exactly encouraging for beginners getting into code is it?

Still thanks for the comprehensive answer!

rydavim
rydavim
18,814 Points

Well, after you fix your permissions you can turn it back on. I turned mine back on.