Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sass master problem #28

Closed
slbug opened this issue Nov 26, 2010 · 11 comments
Closed

sass master problem #28

slbug opened this issue Nov 26, 2010 · 11 comments

Comments

@slbug
Copy link

slbug commented Nov 26, 2010

not completely sure if it's sass or compass problem, but...
Gemfile:

gem 'rails',                 :git => 'git://github.com/rails/rails.git'
gem 'arel',                  :git => 'git://github.com/rails/arel.git'
gem 'rack',                  :git => 'git://github.com/rack/rack.git'
gem 'haml',                  :git => 'git://github.com/nex3/haml.git'
gem 'sass',                  :git => 'git://github.com/nex3/sass.git'
gem 'compass',               :git => 'git://github.com/slbug/compass.git', :branch => 'master'

(using my compass fork just because of fixed gemspec to work with haml 3.1)

config/compass.rb

project_type = :rails
project_path = Compass::AppIntegration::Rails.root
http_path = "/"
css_dir = "public/stylesheets"
sass_dir = "app/stylesheets"
environment = Compass::AppIntegration::Rails.env

Problem: sass not generating css files. i removed everything from public/stylesheets and next browser refreshes gives

ActionController::RoutingError (No route matches "/stylesheets/screen.css"):

downgrading sass version to '3.1.0.alpha.32' helps. everything works.

@nex3
Copy link
Contributor

nex3 commented Nov 26, 2010

This is because of the new Sass/Rails integration, in which Sass stylesheets are treated as Rails views rather than compiled separately. If you put your stylesheets in app/views (as .css.scss or .css.sass), they'll work from there.

I'll leave this issue open to remind me to print a message about this when Sass notices you have a public/stylesheets/sass directory.

@slbug
Copy link
Author

slbug commented Nov 26, 2010

so even is css_dir = "public/stylesheets" i should put my css.scss files to css_dir = "public/stylesheets/sass"?

@slbug
Copy link
Author

slbug commented Nov 28, 2010

tried to put *.css.scss to app/views/stylesheets and changed compass config, but it still not works.

@nex3
Copy link
Contributor

nex3 commented Nov 28, 2010

Do you have routing and a controller set up for app/views/stylesheets?

@slbug
Copy link
Author

slbug commented Nov 28, 2010

no. should i?

@nex3
Copy link
Contributor

nex3 commented Nov 28, 2010

Yes, since they're just views, they need to have routes and a controller set up just like other views.

@slbug
Copy link
Author

slbug commented Nov 29, 2010

ok. thanks it works, but as i understood it wont generate css files anymore. and i think it's bad, because it won't be possible to handle css requests without rails (only using apache or nginx).

@nex3
Copy link
Contributor

nex3 commented Nov 29, 2010

You can always manually include Sass::Plugin::Rack in your middleware stack if you want to generate static CSS files. However, under most configurations, you'll still be hitting Rack/Rails somewhere in the stack.

@maca
Copy link

maca commented Apr 26, 2011

Compass init generates sass files in the previous place, I moved my stylesheets into app/views/stylesheets, created an stylesheets controller and setted my routes but I still get this error.

ActionView::MissingTemplate (Missing template stylesheets/screen with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml, :haml], :formats=>[:css], :locale=>[:"pt-BR", :"pt-BR"]} in view paths

@maca maca reopened this Apr 26, 2011
@nex3
Copy link
Contributor

nex3 commented Apr 26, 2011

@maca: rather than re-opening old, tangentially related issues, please start a new issue. Also, please provide more detailed information about the steps that you're taking, the precise problem you're seeing, and how to reproduce it.

@nex3 nex3 closed this as completed Apr 26, 2011
@maca
Copy link

maca commented Apr 26, 2011

Well I am starting a new vanilla rails app and I want to use compass and susy, I ran compass init and compass generated the sass files in app/stylesheets. From what I read in this thread having sass files in app/stylesheets is no longer the standard way and for rails integration I should create a controller for my stylesheets and store my sass files in app/views, right?

Now the problem is that apparently there is no handler for sass files so the controller doesn't know what to do with my sass templates even though they are there and are named *.css.sass.

My inmediate temporary workaround was mounting a Sinatra app and using Tilt to render the sass templates, ok, it works but gets me into other issues with compass such as this:

 Sass::SyntaxError - File to import not found or unreadable: susy/susy.
 Load path: .:

I joined this thread because I was having the same issue as slbug:

 ActionController::RoutingError (No route matches "/stylesheets/screen.css"):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants