1. 程式人生 > >MacOS-修改環境變數

MacOS-修改環境變數

  1. 修改當前使用者.bash_profile, 新增RabbitMQ程式路徑。

    Stars-MacBook-Pro:/ star$ cd ~
    Stars-MacBook-Pro:~ star$ vi .bash_profile
    Stars-MacBook-Pro:~ star$ cat .bash_profile
    # Setting PATH for Python 3.6
    # The original version is saved in .bash_profile.pysave
    export PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
    
    # added by Anaconda3 5.2.0 installer
    export PATH="/Users/star/anaconda3/bin:$PATH"
    
    # Add RabbitMQ
    export PATH="/usr/local/sbin:$PATH"
    
  2. source使修改生效。

    Stars-MacBook-Pro:~ star$ source .bash_profile
    
  3. 執行RabbitMQ驗證環境變數是否新增成功 。

    Stars-MacBook-Pro:~ star$ cd /
    Stars-MacBook-Pro:/ star$ rabbitmq-server
      ##  ##
      ##  ##      RabbitMQ 3.7.8. Copyright (C) 2007-2018 Pivotal Software, Inc.
      ##########  Licensed under the MPL.  See http://www.rabbitmq.com/
      ######  ##
      ##########  Logs: /usr/local/var/log/rabbitmq/
    [email protected]
    /usr/local/var/log/rabbitmq/[email protected]_upgrade.log Starting broker... completed with 6 plugins.