PDA

View Full Version : SDK Tools for Mac overwrites system $PATH and breaks the command line



curtisdf
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
/Applications/Sencha


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.

stever
22 Aug 2011, 4:59 PM
Look in ~/.bashrc

curtisdf
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?

stever
22 Aug 2011, 5:09 PM
Oh, the Mac, sorry. Try ~/.profile

curtisdf
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
export PATH=/Applications/SenchaSDKTools-1.2.3:$PATH
export PATH=/Applications/SenchaSDKTools-1.2.3/command:$PATH
export PATH=/Applications/SenchaSDKTools-1.2.3/jsbuilder:$PATH
export PATH=/Applications/SenchaSDKTools-1.2.3/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!

mattopenstack
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.

npenny
14 Mar 2012, 8:29 AM
I've built in Sencha/Javascript, but I'd never used the Terminal before. I had the exact problems here and was totally lost, so I'd like to add in layman's terms how I fixed it. I would also like to add that while this worked for me, I am not a Terminal expert and I would still take an extreme level of caution when using it.

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
Productions-MAC:~ Productions$


If I typed

echo $PATH
it gave me

/Applications/SenchaSDKTools-2.0.0-Beta/jsbuilder:/Applications/SenchaSDKTools-2.0.0-Beta:/Applications/SenchaSDKTools-2.0.0-Beta/bin:/Applications/Sencha

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?

simondavies
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?

thanks

felipeqga
27 Apr 2014, 8:17 AM
Hello friends,
I solved the installation several errors sencha changing the following:
Two VERY IMPORTANT files:


/Users/sencha/.bashrc
/Users/sencha/.bash_profile

Hello friends,
I solved the installation several errors sencha changing the following:
Two VERY IMPORTANT files:


My install folder:
/ Sancha
Default installation location:
/ Applications/SenchaSDKTools-2.0.0-Beta /


Take a look:

nano /Users/sencha/.bash_profile


export PATH=/Users/sencha/bin/Sencha/Cmd/4.0.4.84:$PATH


export SENCHA_CMD_3_0_0="/Users/sencha/bin/Sencha/Cmd/4.0.4.84"


export PATH=/Sencha/SenchaSDKTools-2.0.0-beta3:$PATH


export SENCHA_SDK_TOOLS_2_0_0_BETA3="/Sencha/SenchaSDKTools-2.0.0-beta3"
#
export PATH=/Applications/SenchaSDKTools-2.0.0-beta3:$PATH


export SENCHA_SDK_TOOLS_2_0_0_BETA3="/Applications/SenchaSDKTools-2.0.0-beta3"


SENCHA_SDK_TOOLS_2_0_0_BETA3=/Applications/SenchaSDKTools-2.0.0-beta3/
#
export PATH="$PATH:/usr/local/bin"
export PATH=/Users/admin/bin/Sencha/Cmd/4.0.4.84:$PATH
export SENCHA_CMD_4_0_0="/Users/admin/bin/Sencha/Cmd/4.0.4.84"
#
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/command:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/jsbuilder:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/appbuilder:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/command:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/jsbuilder:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/appbuilder:$PATH


#---------------------------------------------------------------------------------#
nano /Users/sencha/.bashrc


export PATH=/Users/sencha/bin/Sencha/Cmd/4.0.4.84:$PATH


export SENCHA_CMD_3_0_0="/Users/sencha/bin/Sencha/Cmd/4.0.4.84"


export PATH=/Sencha/SenchaSDKTools-2.0.0-beta3:$PATH
#
export SENCHA_SDK_TOOLS_2_0_0_BETA3="/Sencha/SenchaSDKTools-2.0.0-beta3"


export PATH=/Applications/SenchaSDKTools-2.0.0-beta3:$PATH


export SENCHA_SDK_TOOLS_2_0_0_BETA3="/Applications/SenchaSDKTools-2.0.0-beta3"


SENCHA_SDK_TOOLS_2_0_0_BETA3=/Applications/SenchaSDKTools-2.0.0-beta3/
#
export PATH="$PATH:/usr/local/bin"
export PATH=/Users/admin/bin/Sencha/Cmd/4.0.4.84:$PATH
export SENCHA_CMD_4_0_0="/Users/admin/bin/Sencha/Cmd/4.0.4.84"
#
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/command:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/jsbuilder:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/appbuilder:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/command:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/jsbuilder:$PATH
#export PATH=/Applications/SenchaSDKTools-2.0.0-Beta/appbuilder:$PATH






####--comando




cd /Applications/XAMPP/xamppfiles/htdocs/touch ; sencha generate app teste ../teste