2

I am installing Drush on my Mac following the instructions I found on https://linode.com/docs/websites/cms/drush-drupal/.

Everything works perfect, but I got stuck at the end while creating the symbolic link. Please find the error below.

Mudasirs-iMac:/ mudasir$ sudo ln -s /usr/local/src/drush/drush /usr/bin/drush

ln: /usr/bin/drush: Operation not permitted
  • You should look into homebrew it is a package manager for Mac. Basically, a tool for installing tools. – Eyal Jan 19 '16 at 6:25
  • Another tool that you can use to install drush is composer. Which is a php package manager. – Eyal Jan 19 '16 at 6:26
  • You simply don't have the permissions to usr/bin anymore as in earlier versions of mac. Use usr/local/bin instead. So the command should be adjusted to sudo ln -s /usr/local/src/drush/drush /usr/local/bin/drush instead. – leymannx Apr 24 '18 at 13:38
1

You can't write to /usr/bin on OSX (since Yosemite).

Add your symlink to /usr/local/bin instead, and make sure that's in your path.

ln -s /usr/local/src/drush/drush /usr/local/bin/drush
  • Thanks, how can I get to know that its in my path or how can I add this to my path – Mudasir Jan 18 '16 at 14:14
  • Depends, but for bash: stackoverflow.com/questions/11025980/… – Clive Jan 18 '16 at 14:32
  • @Mudasir, after creating the symlink into /usr/local/bin, just try typing "dru" and hit "Tab" key to see if it completes it to "drush". Then that means that /usr/local/bin is in your path. Also you can check by typing "echo $PATH" into terminal and find /usr/local/bin there. If it's not in your path environment, then simply follow the link Clive put above and add it to your path. Make sure you do "source ~/.bash_profile" or logout/login to your mac after changing .bash_profile to get the new path variable loaded. – Beebee Jan 18 '16 at 15:06
  • Hi, thanks for you guys help, when I am looking for path it shows me /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin:/usr/bin, I can find /usr/local/bin there, but while creating the symblink, I still have the same issue. – Mudasir Jan 19 '16 at 5:42
  • 1
    True but some enterprising individual could have removed it @leymannx, was just covering all bases I guess :) Thanks for adding the command sample, I removed sudo as it's not required and may cause issues for some people – Clive Apr 24 '18 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.