Why not upgrading your QGIS version?
To know the GRASS path, you need to know how Processing really works.
- First, it is a Python module (processing) that uses subprocess to execute the original GRASS commands.
- Consequently, the script need to know the Grass installation path.
With Python in the console, you can obtain the default path (I suppose you use the Kyng Chaos version).
1) For Grass 6.4.x
The script to find the default Grass path is:
/Applications/QGIS.app/Contents/Resources/python/plugins/processing/algs/grass/GrassUtils.py #lines 256-258 for your QGIS version
import processing
# you want to use here the Grass algoritm
import processing.algs.grass.GrassUtils as ga6
ga6.GrassUtils.grassPath()
u'/Applications/QGIS.app/Contents/MacOS/grass'
Therefore, by default, processing uses the GRASS version installed into the QGIS application with the script grass.sh to launch GRASS and execute commands.
import os
os.path.exists(ga6.GrassUtils.grassPath() + os.sep + 'grass.sh')
True
You can let the Processing Options (path to GRASS) empty. QGIS always find the path.
If you want to use another GRASS version (GRASS-6.4.6.app for example), simply change the parameters in the Processing Options with a folder path that contains the grass.sh script (/Applications/GRASS-6.4.6.app/Contents/MacOS
for example).
os.path.exists('/Applications/GRASS-6.4.6.app/Contents/MacOS/grass.sh')
True
# and
ga6.GrassUtils.grassPath()
/Applications/GRASS-6.4.6.app/Contents/MacOS
os.path.exists(ga6.GrassUtils.grassPath() + os.sep + 'grass.sh')
True
Result:
2) For Grass 7.x
Same procedure and the file is:
/Applications/QGIS.app/Contents/Resources/python/plugins/processing/algs/grass7/Grass7Utils.py
import processing.algs.grass7.Grass7Utils as ga7
ga7.Grass7Utils.grassPath()
'/Applications/GRASS-7.0.app/Contents/MacOS'
import os
os.path.exists(ga7.Grass7Utils.grassPath() + os.sep + 'grass70.sh')
False
Problem here, I have a GRASS-7.0.app (from GRASS GIS for Mac) installed but no /Applications/GRASS-7.0.app/Contents/MacOS/grass70.sh
script. The script to launch GRASS-7.0.app is /Applications/GRASS-7.0.app/Contents/MacOS/grass.sh
The solution is to replace grass70.sh by grass.sh in the lines 254-256 of the script Grass7Utils.py
Original:
if isMac() and os.path.exists(Grass7Utils.grassPath() + os.sep + 'grass70.sh'):
command = Grass7Utils.grassPath() + os.sep + 'grass70.sh ' \
+ Grass7Utils.grassMapsetFolder() + '/PERMANENT'
Correction:
if isMac() and os.path.exists(Grass7Utils.grassPath() + os.sep + 'grass.sh'):
command = Grass7Utils.grassPath() + os.sep + 'grass.sh ' \
+ Grass7Utils.grassMapsetFolder() + '/PERMANENT'
Result:
Hope this will help you but there are many problems with El Capitan (from GRASS GIS for Mac and Grass Gis 7 does not start in OS X 10.11 El Capitan)
WARNING: current GRASS binaries may not work with EL CAPITAN - OS X 10.11 unless you disable "System Integrity Protection".
Best Answer
I have figured this out and thought it best to post the answer for future users.
Firstly, I right clicked on my QGIS application and selected 'Show Package' to show the subfolders within the application (apologies if this is obvious to most users but it wasn't to me!)
In doing this I managed to locate the exact path of my GRASS installation, which is /Applications/QGIS.app/Contents/MacOS/grass7.
I replaced both GRASS folder locations shown in the screengrab above (within my original question) with the correct path, but only ticked 'Activate' on GRASS GIS 7 commands. (As I assume these supersede the standard GRASS commands.)
This still didn't fix the problem, however I then noticed in Plugins > GRASS > Grass Options, under the General tab there is an option to insert a custom file path to the Grass installation, so I pasted the same file path in here.
After restarting QGIS I now have working GRASS again.