Cómo modificar la RUTA para Homebrew?


Intentando instalar ruby 1.9.3, lee que primero necesito instalar homebrew. Ran brew doctor, y me está dando un montón de advertencias. Uno de los cuales es:

Advertencia: /usr / bin ocurre antes de / usr / local / bin Esto significa que los programas proporcionados por el sistema se utilizarán en lugar de los proporcionados por Homebrew. Existen las siguientes herramientas en ambas rutas:

easy_install
easy_install-2.6

Considere modificar su RUTA para que /usr/local/bin esté por delante de /usr / bin en su CAMINO.

¿Cómo ¿uno hace lo que está pidiendo aquí?

Author: jww, 2012-04-27

5 answers

Abra su archivo/etc /paths, ponga/usr/local /bin encima de/usr / bin

$ sudo vi /etc/paths
/usr/local/bin
/usr/local/sbin
/usr/bin
/bin
/usr/sbin
/sbin

Y Reinicie el terminal , @mmel

 285
Author: fengd,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-11-15 04:18:40

Hay muchas maneras de actualizar tu ruta. La respuesta del 1 de junio funciona muy bien. Otro método es aumentar su .bash_profile para tener:

export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"

La línea de arriba coloca /usr/local/bin y /usr/local/sbin delante de tu $PATH. Una vez que source your .bash_profile or start a new terminal you can verify your path by echo'ing it out.

$ echo $PATH
/usr/local/bin:/usr/local/sbin:/Users/<your account>/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

Una vez satisfecho con el resultado, ejecutar $ brew doctor de nuevo ya no debería producir su error.

Esta entrada de blog me ayudó a resolver los problemas que corrí en. http://moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac /

 73
Author: avelis,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-07 19:28:03

Simplemente ejecute la siguiente línea en su aplicación de terminal favorita:

echo export PATH="/usr/local/bin:$PATH" >> ~/.bash_profile

Reinicie su terminal y ejecute

brew doctor

El problema debe resolverse

 15
Author: iceturk22,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-10-31 01:00:13

Para evitar duplicaciones innecesarias, agregué lo siguiente a mi~/.bash_profile

case ":$PATH:" in
  *:/usr/local/bin:*) ;;     # do nothing if $PATH already contains /usr/local/bin
  *) PATH=/usr/local/bin:$PATH ;;  # in every other case, add it to the front
esac

Crédito: https://superuser.com/a/580611

 0
Author: mycargus,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-03-20 10:18:17

Abrir perfil bash en TextEdit

Abrir-e .bash_profile

Editar archivo o pegar delante de la RUTA export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:~/bin

Guardar y cerrar el archivo

*Para abrir .bash_profile abrir directamente TextEdit > file > recent

 0
Author: Siddhant Raut,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-06-17 11:18:19