views:

39

answers:

1

I am writing a sinatra app with haml and sass. When I try to link in the stylesheet with a scss extension located in my views folder I get the following error: NoMethodError at /nav.css undefined method `scss'

Here is my get method

get '/nav.css' do 
    content_type 'text/css', :charset => 'utf-8'
    scss :nav
end

I have only gotten this to work when I switch to the older sass syntax. I also have to change the nav.scss to nav.sass and the get method to sass :nav

I have also tried just having sass :nav with nav.scss and sass :nav with nav.sass but still scss syntax

+1  A: 

Excerpt from Sinatra README

## You'll need to require haml or sass in your app
require 'sass'

get '/stylesheet.css' do
  scss :stylesheet
end

Are you required the sass gem?

What version of Sinatra you use. Support for scss was added in 2010.09.01 (same day version was increased from 1.0 to 1.1), perhaps you need and update.

kfl62
I am requiring the haml gem. I also tried requiring just sass and both sass and haml but not none of them worked. I have no trouble rendering haml views or the old sass syntax stylesheets but the new ones are a problem.
Ben
Updated answer :)
kfl62
I installed sinatra during the first week of Oct. but for some reason gem install sinatra fixed the problem
Ben
Officially the Sinatra 1.1.0 was released 3 days ago, so before `gem install` installed Sinatra 1.0, meanwhile was some pre `gem install sinatra --pre`. Anyway glad you succeed :).
kfl62