user2384124
user2384124

Reputation:

NoMethodError on line ["32"] in Rails 3.2 with latest Compass and Sass

I have been searching around a bit to find a solution to this error message I am getting and based on my research it would appear this error should have been fixed in the latest compass-rails and/or sass-rails gem releases. However, I am still getting the error message and it is probably because I am missing something silly.

I am getting the error message when running the compass compile command.

The full error message is:

NoMethodError on line ["32"] of /home/mike/.rvm/gems/ruby-1.9.3-p392/gems/sass-rails-3.2.6/lib/sass/rails/helpers.rb: undefined method `[]' for nil:NilClass

My .scss file looks like this:

 @import "base";


#container {
   @include background-image(linear-gradient(#CBD7E2, #00AEEF)); 
   @include background-size(auto);

   padding: $container-pad;
}

#header {
   background-image: image-url("logo.gif");
}

Logo.gif is located in the rails project directory in app/assets/images.

What am I missing / doing wrong here? Please let me know if you need more information.

Thanks, Meebix


Update: Seems I just needed URL. I am still not able to get an image to render to the browser however. I have my image in assets/images. I notice that compiling compass doesn't move any images to the public/assets folder (not sure if that is even supposed to happen).

What am I forgetting to do?

Upvotes: 0

Views: 528

Answers (1)

lis2
lis2

Reputation: 4264

http://www.w3schools.com/cssref/pr_background-image.asp

In my opinion that

background-image: image-url("logo.gif");

should be

background-image: url("logo.gif");

Upvotes: 0

Related Questions