.bash profile - Correct .bash_profile in OSX -


i need use tools, have problems when try use php artisan in laravel , cordova, need comment lines, because $path not working fine. noob working unix :)

to more specific in question, need these lines work fine together, without need uncomment , comment depending of tool need use:

export path="/applications/xampp/xamppfiles/bin:$path" export path=~/.composer/vendor/bin:$path 

errors have when uncommented each one:

case 1: cordova can run in xcode version 4.6 or greater.

case 2: mcrypt php extension required.

edit: i've added complete bash profile:

# next line updates path google cloud sdk. source /users/chema/google-cloud-sdk/path.bash.inc # next line enables bash completion gcloud. source /users/chema/google-cloud-sdk/completion.bash.inc  #comment line make cordova works fine #export path="/applications/xampp/xamppfiles/bin:$path" export path=${path}:/users/chema/sdk-android/sdk/platform-tools:/users/chema/sd$ #comment line make php artisan laravel works fine export path=~/.composer/vendor/bin:$path export android_home=/users/chema/sdk-android/sdk export path=${path}:$android_home/tools:$android_home/platform-tools 

if uncomment 2 lines, works php artisan laravel.

echo path when cordova it's working , php artisan doesn't:

which xcodebuild /usr/bin/xcodebuild

/users/chema/.composer/vendor/bin:/users/chema/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/users/chema/sdk-android/sdk/platform-tools:/users/chema/sdk-android/sdk$:/users/chema/sdk-android/sdk/tools:/users/chema/sdk-android/sdk/platform-tools

echo path when php artisan it's working , cordova doesn't:

/applications/xampp/xamppfiles/bin:/users/chema/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/users/chema/sdk-android/sdk/platform-tools:/users/chema/sdk-android/sdk$:/users/chema/sdk-android/sdk/tools:/users/chema/sdk-android/sdk/platform-tools

which xcodebuild /usr/bin/xcodebuild

thanks!!

ok after digging. think i've figured out

what happening head command cordova needs lives in /usr/bin/head on osx, being overshawdowed version supplied xampp. path order needs adjusted. which head when xampp uncommented should give /applications/xampp/xamppfiles/bin/head opposed /usr/bin/head

that being said try making path follows.

export android_home=/users/chema/sdk-android/sdk export path=~/.composer/vendor/bin:$path export path=$android_home/tools:$android_home/platform-tools:$path export path=$path:/applications/xampp/xamppfiles/bin 

this should put xampp version of head @ end of path. might cause other name collisions cause xampp not work (i don't have either installed cannot test) (also removed the export path=${path}:/users/chema/sdk-android/sdk/platform-tools:/users/chema/sd$ adding looked redundant /wrong paths path)

if still doesn't work, best bet might create wrapper script run cordova, sets path 1 know works , passes command line options along

--edit--

on osx path built path_helper builds path /etc/paths && /etc/manpaths run shells init code /etc/profile, /etc/zshenv, etc.. , sets base path

based on comment of head still being 1 in /applications/xampp/xamppfiles/bin appears line export path=$path:/applications/xampp/xamppfiles/bin either not being executed, or /applications/xampp/xamppfiles/bin in path somewhere else (ie keep sourcing .bashrc, or opposed creating new shell, etc.. )

so try this. put following in reset_paths.sh

#!/bin/sh export path= if [ -x /usr/libexec/path_helper ];     eval `/usr/libexec/path_helper -s` fi path=~/.composer/vendor/bin:$path path=$android_home/tools:$android_home/platform-tools:$path path=$path:/applications/xampp/xamppfiles/bin export path 

what reset path, execute path_helper set paths os, , tack on starting fresh..

then in shell source ./reset_paths.sh

then try run cordova shell , see if works.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -