Magento2: After delete pub/static folder and making deploy, no css files found - css

I searched the web, but found no answer that would work:
I use Magento 2 custom theme and when I made changes to .less file, I wanted to compile files, so I deleted pub/static folder and made deploy: php bin/magento setup:static-content:deploy.
After that, no css files are found in pub/static/frontend/<Theme>/default/css.
Also, when I use grunt less, I got errors:
>> Destination pub/static/frontend/Magento/blank/en_US/css/styles-m.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/styles-l.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/email.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/email-inline.css not written because no source files were found.
I am in a developer mode.
Does anyone have any solution for this?
Thank you

I had the same issue, when I did grunt refresh I got the same errors.
To resolve this I removed var/di, var/cache, var/generation, var/page_cache and the contents of pub/static folder (be careful not to remove pub/static/.htaccess).
Then I tried: grunt exec:themename
If successful do, grunt clean
If successful do, grunt refresh
And then, setup:static-content:deploy
This worked for me.

You need to retrieve the file .htaccess from the pub/static folder.
I found it here: https://github.com/magento/magento2/blob/develop/pub/static/.htaccess
*Check the version you use of magento

Related

qmake: could not open config file

I'm trying to get Qt running again. I think I screwed a couple of things up by manually deleting the /usr/lib/x86_64-linux-gnu/qt5 folder.
I think I got most of it reinstalled correctly but not I got the following problem.
When I check the qmake version i.e.
qmake --version
I get the following message.
qmake: could not open config file '/usr/lib/x86_64-linux-gnu/qtchooser//default.conf': No such file or directory
I don't understand why there is a second slash in the path. The default.conf file exists in the path without the second slash.
Is there a way to modify the path?
Really appreciate any help.

missing .dependencies in user/ when bin/grav

I'm trying to install Grav on Heroku following the learn.getgrav.org docs.
I've got the web app deployed successfully, however it tells me to bin/grav install.
I do that and it gives me the following output:
ERROR Missing .dependencies file in user/ folder
I do not know what to do at this point as it's happened everytime I've installed Grav.
Hope this will be solved.
Sadly this problem is all too common when copying files :(
hidden (dotted) files are not always copied.
.dependencies
.htaccss
using ls -l -a in the folder where you extracted the files originally Dowloads/grav I could see the files that were not copied to fix it
cp .dependencies .htaccss /var/www/grav/
When I install GRAV on my server each time, I always copy the Zip file to the server, unzip it in place, then remove the zip file - using this method I have never had a problem with the installing of GRAV
HTH Rich

How to add Compass syntax support to Jetbrains PhpStorm?

I'm using JetBrains PhpStorm, which is probably the most epic IDE I've ever used.
The question is simple. How do I add Compass syntax support to it? I've got it installed, it renders and works, but PhpStorm still complains about undefined imports and mixins.
How can I resolve this? Can Compass be included as an external library?
Edit: I'd just like to note that this feature request is for the RubyMine IDE (also by JetBrains), it's not for PhpStorm/WebStorm.
It's explanation of Martin's answer.
Symlink to compass gem directory in your sass folder works great.
Instruction(Windows)
open cmd with admin privileges
change path to your project sass folder, for example cd projectname\sass
run mklink /d compass $GEM_LOCATION\frameworks\compass\stylesheets\compass, as for me $GEM_LOCATION = C:\dev\Ruby200\lib\ruby\gems\2.0.0\gems\compass-0.12.2
Thats all, now PhpStorm will not highlight compass mixins as errors, and will add them in autocomplete suggestions.
Warning: If you want to delete created symlink DON'T use delete, it will remove source directory.
open cmd with admin privileges, cd $yourProjectSassPath, and run rmdir compass
As the above user mentioned it also works to add the path to the Compass stylesheets as a resource directory in your project.
For example, my compass stylesheets are located at:
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/compass/stylesheets
Go to Settings > Project settings > Directories.
Add a content root
Add the compass stylesheets directory
Click 'Resource Root' (the blue icon)
When you apply you will see that PhpStorm finds the compass stylesheets without any problems. You can even ctrl+click (windows) on them to open them directly.
Good luck!
I solved it by placing a symlink of the compass-directory (from $GEM_LOCATION/frameworks/compass/stylesheets/compass) into the folder where my stylesheet lives. It's more of a workaround but it makes me and the phpstorm-inspections/-autocompletion happy.
I think it's better to add the directory in the Directories settings: http://www.jetbrains.com/phpstorm/webhelp/directories.html
In the example above, add a new content root of C:\dev\Ruby200\lib\ruby\gems\2.0.0\gems\compass-0.12.2.
This is more easily fixed by using a better source for the executable.
From: http://youtrack.jetbrains.com/issue/WEB-9139
In Windows, use an executable path like:
C:\Ruby200\lib\ruby\gems\2.0.0\gems\compass-0.12.2\bin\compass
While on the Mac use something like:
/Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass

Build script not working with HTML5Boilerplate new download

My first problem was that, though the documentation warned the JDK was required, and though I set the bin directory to that of the JDK, tools.jar was being searched for in the JRE folder. This made no sense, but I copied the tools.jar file over and it got past that problem. The next problem I had was the build script failing due to a failure to find a main.css file. I'm on a Windows 7 machine, and this is what I did to attempt the build:
Downloaded WinAnt v7 and installed it, specifying the jdk1.7.0_04/bin folder when asked for a Java directory.
Downloaded and unpacked a brand new package from HTML5Boilerplate, keeping the extra comments and such.
Downloaded the build project, unpacked it, and dropped its contents into a build folder at the root of the HTML5Boilerplate folder.
Opened a command prompt, navigated to the build directory, and ran the ant command.
The only thing I could think of that was causing the JDK/JRE problem was that this is a 64-bit system. That's just a guess, but the copied file worked OK for now.
This process performs some of the work without complaint, creating intermediate and publish directories, but then fails out, saying that it can't find a main.css file to copy. I want to stress that I didn't make any modifications at all to the files, so I'm confused as to why the build script can't find a file I didn't remove or rename. In the config/default.properties file of the build folder, on lines 74 and 80, it hard-codes main.js and main.css as file names used. I'm not sure if those are supposed to be dynamically generated, or if they must be manually created and included in the project for the build script to run. If so, why doesn't the default structure downloaded from the website have them? If they're dynamically created, I need advice on what is going wrong.
I'd really like to get this up and running so I can get started using HTML5Boilerplate, but I'm a little lost here.
-edit
After renaming the styles.css file to main.css, the build completed correctly, but the resulting files aren't correct. I read that the script would update the html file references to css and javascript files, but it didn't. For instance, I ended up with e68668b.css after the script ran, but the html file still referenced styles.css. Same for the javascript file. Help!
I found the problem. The build script is now a separate project, which I downloaded from github. I downloaded the HTML5Boilerplate zip file from the HTML5Boilerplate website, which unfortunately still has the old folder structure. I went to github and downloaded the HTML5Boilerplate template there, and that made the difference.
The HTML5Boilerplate website's link points to github's 3.0.2 version
The github's link points to version 3.0.2-69
And that's all she wrote. The names of some files changes, as well as some of the folder structure, between these two versions, and the build script I downloaded referenced the newest structures.

Asdocs seems unable to find embedded assets

I'm running asdocs from a .bat file with flex sdk 3.2.0 (I have replaced my long project root folder with PROJECTROOT):
"C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.2.0\bin\asdoc" -source-path . "C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.2.0" "_PROJECTROOT_\Components\src" "C:\_PROJECTROOT_\assets" -doc-sources .
PAUSE"
Unforunately, I keep getting errors similar to this:
"_PROJECTROOT_\assets\styles.css(344): Error: Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "close_button.png")'.
downSkin: Embed(source="close_button.png");"
I really don't understand this as "close_button.png" is in the same folder as styles.css. When I build the project from within flexbuilder, it compiles it fine and does not throw any errors.
Does anyone know what I'm doing wrong?
It's not using your folder with the CSS as the root folder when it's working. It's looking for the assets in the folder you are running the commands from.
Try adding the assets folder to your source path.
I had a similar problem, and an answer I found elsewhere indicated to put a slash at the beginning of the asset path. That is, instead of
Embed(source="close_button.png")
rather
Embed(source="/close_button.png")

Resources