PDA

View Full Version : SCSS compilation doesn't work at all



mishoboss
3 Jan 2012, 3:53 AM
Hi, I develop an app in Sencha 2 (yes, I know this post is in Sencha 1.x forums) and would like to have several different themes that users will choose from. I saw Sencha uses SCSS which is really great. However here starts the real pain! Of course Ruby is not my "native" language and I had a lot of problems running it and configured it on Windows. But I've done this. Then I started to read the Sencha documentation about using SASS and Compass... it was more like a blog post than a real documentation and it was clearly outdated. After reading a lot of forum posts I managed to run it with the right paths. And... errors! I thought Sencha 2 is not quite ready for this as it is just at developers preview state. So, I tried with Sencha 1.1 and... errors again. After readinga lot of other forum posts and comments under blog posts, I knew I had to try with different Compass versions and some additional Ruby packets. But after trying all this, I didn't managed to compile a single CSS file...


So, the logical question here is WHY YOU USE COMPASS for this? And when you decided to use it, why you didn't made a good and useful documentation and update it according the Sencha versions and Compass versions? It is useless now.


As I saw on other forum posts there are a lot of questions why you decided to use Compass. Really, why? There are a lot of other similar projects that don't use Ruby! What about Less (http://lesscss.org/) for example, or HSS (http://ncannasse.fr/projects/hss)? Or something written in Java (jsass)?

mitchellsimoens
3 Jan 2012, 5:38 AM
I have used compass in ST1 and ST2 projects without a hitch. What isn't working for you? Like what are the error(s) compass is giving you?

mishoboss
3 Jan 2012, 7:46 AM
I've just tried again with Sencha 2.0 PR3 and I get this:



NoMethodError on line ["148"] of C: Тcompass_init
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/inheritance.rb:146:in `method_missing'
D:/Program Files/XAMPP/xampp/htdocs/openHAB2/themes/wood/scss/config.rb:5:in `
parse_string'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/serialization.rb:21:in `eval'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/serialization.rb:21:in `parse_string'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/serialization.rb:15:in `block in _parse'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/serialization.rb:14:in `open'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/serialization.rb:14:in `_parse'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/file_data.rb:29:in `block in new_from_file'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/inheritance.rb:96:in `with_defaults'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/file_data.rb:28:in `new_from_file'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/helpers.rb:42:in `configuration_for'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/configuration/helpers.rb:94:in `add_project_configuration'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/commands/project_base.rb:31:in `add_project_configuration'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/commands/project_base.rb:25:in `configure!'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/commands/project_base.rb:15:in `initialize'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/commands/update_project.rb:29:in `initialize'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/exec/sub_command_ui.rb:42:in `new'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/exec/sub_command_ui.rb:42:in `perform!'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/lib/compas
s/exec/sub_command_ui.rb:15:in `run!'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/bin/compas
s:25:in `block in <top (required)>'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/bin/compas
s:39:in `call'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/bin/compas
s:39:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.2/bin/compass:19:in `load'
C:/RailsInstaller/Ruby1.9.2/bin/compass:19:in `<main>'

The errors were different with different versions of Compass and on Sencha 1.1.


This is the config.rb file:


# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)

# Load the sencha-touch framework automatically.
load File.join(dir, '..', '..', '..', 'resources', 'themes',’compass_init.rb’)

# Compass configurations
sass_path = dir

css_path = File.join(dir, "..", "css")

environment = :production
output_style = :compressed

mitchellsimoens
3 Jan 2012, 8:15 AM
Try it without the 'compass_init.rb' in the path. Here is a sample for mine:



# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)

# Load the sencha-touch framework automatically.
load File.join(dir, '..', 'sencha-touch-1.1.1', 'resources', 'themes')

# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")
environment = :development
output_style = :expanded

mishoboss
3 Jan 2012, 9:27 AM
Then I get another error:


error myapp.scss (Line 3: File to import not found or unreadable: sencha-tou
ch/default/all.
Load paths:
D:/Program Files/XAMPP/xampp/htdocs/openHAB2/themes/wood/scss
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/frameworks
/blueprint/stylesheets
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/frameworks
/compass/stylesheets
Compass::SpriteImporter)
Sass::SyntaxError on line ["3"] of D: File to import not found or unreadable: se
ncha-touch/default/all.
Load paths:
D:/Program Files/XAMPP/xampp/htdocs/openHAB2/themes/wood/scss
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/frameworks
/blueprint/stylesheets
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/compass-0.11.6/frameworks
/compass/stylesheets
Compass::SpriteImporter
Run with --trace to see the full backtrace

On line 3 in myapp.scss is this: @import 'sencha-touch/default/all';

mitchellsimoens
3 Jan 2012, 9:31 AM
Then I get another error:

On line 3 in myapp.scss is this: @import 'sencha-touch/default/all';

That would mean the path is incorrect. I'm not too sure what is wrong as it just works for me. I'm on a Mac so installing things are easier than on Windows so it tells me something isn't right when you installed it.

davidkaneda
4 Jan 2012, 1:36 PM
Yep, sorry for chiming in late, but as Mitchell mentions, it just means you have an error in your paths, either in the config.rb or Sass file. I also don't have experience on Windows, but perhaps you have to @import 'sencha-touch\default\all' ? Also: We went with Sass/Compass because it's far more flexible and powerful than Less, and doesn't actually require Ruby knowledge, aside from a 4-5 line config file.