View Full Version : SDK Tools for Mac overwrites system $PATH and breaks the command line
22 Aug 2011, 2:13 PM
I installed Sencha SDK Tools 1.2.3 on my Intel-based MacBook Pro (Snow Leopard) recently, and shortly after that I noticed problems in my terminal window. Whenever I open a new tab, I now see the following error messages:
-bash: export: `Tools:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin': not a valid identifier
-bash: export: `Tools/command:/Applications/Sencha': not a valid identifier
-bash: export: `Tools/jsbuilder:/Applications/Sencha': not a valid identifier
-bash: export: `Tools/appbuilder:/Applications/Sencha': not a valid identifier
It appears the SDK Tools installer added something to my system that causes my $PATH to be overwritten, as shown below:
# echo $PATH
HUH?!?!?!?! How do I fix this? I tried uninstalling the tools via the uninstall.app it came with, but the problem persists. I'm not sure where else to look. The only way I can use Terminal.app now is to manually re-export a sane $PATH value whenever I open a new tab.
The SDK tools weren't even installed in /Applications/Sencha. The installer put them in /Applications/SenchaSDKTools-1.2.3.
22 Aug 2011, 4:59 PM
Look in ~/.bashrc
22 Aug 2011, 5:06 PM
Unfortunately, no ~/.bashrc exists. Also, neither /etc/bashrc nor /etc/profile, nor the files in /etc/paths.d/ has anything new that would be causing this problem.
Is there a plist file somewhere perhaps?
22 Aug 2011, 5:09 PM
Oh, the Mac, sorry. Try ~/.profile
22 Aug 2011, 7:57 PM
Ok yeah, that's the one. Never thought to look there. Funny... here are its contents (blank lines removed):
export PATH=/Applications/Sencha SDK Tools:$PATH
export PATH=/Applications/Sencha SDK Tools/command:$PATH
export PATH=/Applications/Sencha SDK Tools/jsbuilder:$PATH
export PATH=/Applications/Sencha SDK Tools/appbuilder:$PATH
Now that I see this file, I think during a prior install I changed the default installation directory to "Sencha SDK Tools" instead of "SenchaSDKTools-1.2.3" as was the default. So... looks like the installer needs some way to deal with space characters in the installation path, or to prevent entering paths with spaces in the first place.
I commented out all those lines, and my $PATH is set properly now. Thanks!
5 Sep 2011, 2:05 AM
It breaks because those paths name with a space need to be quoted otherwise it is interpreted incorrectly. This is a newb mistake, Sencha should fix this as a priority.
14 Mar 2012, 8:29 AM
Every time I started the Terminal I got:
Last login: Wed Mar 14 10:23:52 on ttys000
-bash: export: `Tools/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin': not a valid identifier
If I typed
it gave me
Uninstalling the SDK Tools didn't fix the issue, neither did reinstalling it.
Turns out the problem stemmed from when I changed the default installation directory for the SDK Tools the first time I installed them, from /Applications/SenchaSDKTools-2.0.0-Beta/ to /Applications/Sencha SDK Tools/. When I couldn't run anything (including the sencha command test here (http://docs.sencha.com/touch/2-0/#!/guide/command)), I figured some basic startup file for Terminal had been modified, which after Googling found was probably my .bash_profile (hidden file found in /Users/UserName/ folder). I ended up being able to open it in the Terminal and found that the first line included a directory that didn't exist (/Applications/Sencha). I deleted that first line, saved the file, and Terminal was back up and running normally with Sencha Command finally working as well.
In order to edit it, I had to also include the full paths for basic commands. This didn't work:
sudo nano /.bash_profileBut this did:
/usr/bin/sudo /usr/bin/nano /.bash_profile(After I deleted the messed up line in .bash_profile, I didn't have to use full paths anymore.)
My guess is that spaces in directory names caused the error, which would explain why it was /Applications/Sencha rather than where I had initially installed it: /Applications/Sencha SDK Tools/. It would also explain why uninstalling the first time didn't fix it.
NOTE: Possibly unrelated, but I had to use
command/sencha app create MyApp ../MyApp/not
sencha app create MyApp ../MyApp/in order to generate the basic app. Is this normal?
2 Jul 2012, 11:20 AM
i managed to get the following running:
/usr/bin/sudo /usr/bin/nano /.bash_profile
but this lists nothing other than then GNU nano 2.0.6 and the menu at the bottom, with a blank screen in between?
Any ideas how i can solve my issue?
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.