Run Grunt deploy task -> Fatal error: Class 'Locale' not found
Question
I NodeJs installed, I installed the Magento2 Grunt that works, but if I run the command "grunt deploy" it delete all from the folder pub/static/ but do not deploy and returns me the error below. Can someone help me?
Running "deploy" task
Cleaning "pub/static"...>> "pub/static" is empty.
Deploying Magento application...
Fatal error: Class 'Locale' not found in /Applications/MAMP/htdocs/magento/Projects/Magento2Theme/vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64
Done, without errors.
Solution
You php do not have intl
extension. You can verify it by run php -i
.
In many cases this problem appear when you have different php version/configurations for apache and cli. For example if use install MAMP on MacOsX that you will have different version. To use php in this case you need specify full path to php like /Applications/MAMP/bin/php/php7.0.0/bin/php
To change it you need to do folowing steps:
Edit ~/.bash_profile
and add
export PATH=/Applications/MAMP/bin/php/php7.x.x/bin:$PATH
where /Applications/MAMP/bin/php/php7.x.x
should be patch to your latest wersion
In Terminal, run source ~/.bash_profile
In Terminal, type in which php
and look for the updated patch. If everything was successful, It should output the new path to MAMP PHP install.
In case it doesn't output the correct path, try closing the terminal window (exit fully) and open again, it should apply the changes (Restart in short).