I am unable to launch swift terminal or unable to do swift build from any other directory (apart from ../swift/usr/bin ) in Ubuntu . When i am in swift folder (../swift/usr/bin) where i installed it, i am able to launch swift REPL but not from any other directory I even exported the bin path to environment variable
export PATH=/home/vinit/swift-2.2-SNAPSHOT-2016-02-24-a-ubuntu14.04/usr/bin:$PATH
I executed this command from bin directory. And checked it with
echo $PATH
I was getting
/home/vinit/swift-2.2-SNAPSHOT-2016-02-24-a-ubuntu14.04/usr/bin:/home/vinit/.linuxbrew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vinit/bin:/usr/local/java/jdk1.8.0_65/bin
but when i executed the same (echo $PATH) from other directory , i am not getting swift in environment variable. Thanks in advance.
答案 0 :(得分:0)
为了让PATH中的swift条目消失,我猜你在导出PATH后重新启动了终端,或者一次打开了多个终端,并试图同时工作。尝试将导出命令放在主文件夹中的.bashrc文件中,然后打开一个新终端。