Sass plugin for playframework

464 views
Skip to first unread message

Florin Pop

unread,
Aug 29, 2013, 11:44:59 AM8/29/13
to play-fr...@googlegroups.com
Hello guys!

I've been trying for a while to configure the playframework to work with .scss files and automatically compile them to .css.
In order to do this, i configured the Build.scala and plugin.sbt  files to add a sass plugin > see here: https://github.com/jlitola/play-sass/blob/master/README.md
The problem is that i don't know how to make it work. I created the wollowing directory \app\assets\sass\  where i stored a .scss file.
When a request is made, the plugin seems to try to compile the file but an error occurs Sass compiler: ruby.exe: No such file or directory -- D:/workspaceNB/aplicatie/sass
Further i created the sass directory inside the root of the project and the next error occurs.
 Sass compiler: ruby.exe: Permission denied -- D:/workspaceNB/aplicatie/sass (LoadError)

Can you help me with an example? What is the directory structure needed in order to make it work? What other configurations are needed?

Thank  you!

Lei Gao

unread,
Aug 29, 2013, 2:03:18 PM8/29/13
to play-fr...@googlegroups.com
I use compass directly, and it just does its work. This way I wont never be bothered with this type plugin headache.

RandomSpark

unread,
Aug 31, 2013, 1:23:32 AM8/31/13
to play-fr...@googlegroups.com
I am using play-sass. It works just fine. You may want to check if you have sass gem installed. The sass plugin internally just calls sass command. So if "sass" works on command prompt it should in build and other things.

kompot

unread,
Sep 1, 2013, 10:01:20 AM9/1/13
to play-fr...@googlegroups.com
IMHO Play frontend support is nowhere near frontend complexity requirements.
I ended up using play-yeoman and yo/grunt/bower for all frontend tasks.

Florin Pop

unread,
Sep 2, 2013, 3:55:23 AM9/2/13
to play-fr...@googlegroups.com
The gem is installed.: "1 gem installed successfully installed sass-3.2.10". Can you show me please how to place the files in order to work. I just created a new play application. Thank you for answer!

Guy

unread,
Sep 30, 2013, 5:38:53 AM9/30/13
to play-fr...@googlegroups.com
Hi Florin. 
I have been using play!framework 2.0.4 with sass for a year now. 

I can tell you that what you have is a problem specific to your environment and it should not happen at all.. 

The correct folder structure in play!framework to get sass working is simply put the "scss" files under "app/assets". 
My structure is 
app
  +---- assets
           +------ styles
                      +----------my.scss

and I import css files with the following path "/public/styles/my.css"

One of my teammates got the same error as you (he is the only one to get this error) and we are looking for a way to resolve this. So if anyone knows about a way, please let me know. 

Guy

unread,
Oct 1, 2013, 3:34:59 AM10/1/13
to play-fr...@googlegroups.com
Hi again florin, 

As I stated before the correct structure is 
app -> assets -> more_folders_as_you_see_fit -> file.scss

This will compile it under
public -> more_folders_as_you_see_fit->file.css

We finally found a work-around to the problem. 
You may read my answer on stackoverflow describing this work-around http://stackoverflow.com/a/19110387/1068746

The gist is that you can copy the file RUBY_HOME\bin\sass  ( a ruby file ) to be at your play project root directory. 

It seems that ruby is looking for it there. 
Since ruby is looking for a file and not a folder - you get permission denied when you create a folder instead. 

Hope this helped. 
Reply all
Reply to author
Forward
0 new messages