Ram Pavan Kumar
Ram Pavan Kumar

Reputation: 3

undefined method `[]' for "font":Sass::Script::Value::String

I am running my rails application I encountered the above error.

I guess it has something to do with sass rails and font awesome.

Here is my gemfile

        source 'https://rubygems.org'
ruby '2.2.3'

gem 'rails', '4.2.6'
gem 'jquery-rails'
gem 'jquery-turbolinks'
gem 'jquery-ui-rails'
gem 'devise'
gem 'simple_form'
gem 'will_paginate'
gem 'bootstrap-will_paginate'
#gem 'activerecord-reputation-system', require: 'reputation_system'
gem 'activerecord-reputation-system', github: 'NARKOZ/activerecord-reputation-system', branch: 'rails4'
gem 'acts-as-taggable-on'
gem 'randumb'

gem 'turbolinks'

gem 'mobu'
#gem 'font_assets' rails 3?
#gem 'font-awesome-rails', '4.2' #'3.1.1.0'
gem 'font-awesome-rails'
gem 'protected_attributes' #for attr_accesible instead of strong params..



#this is active admin gem
#gem 'activeadmin', github: 'activeadmin'
gem 'activeadmin', '~> 1.0.0.pre2'
gem 'rack-cors', :require => 'rack/cors'

#group :assets do

gem 'sass-rails', '~> 5.0'
gem 'coffee-rails' #, '~> 3.2.1'
gem 'uglifier' #, '>= 1.0.3'
gem 'bootstrap-sass'
gem 'tzinfo-data' #rails 4 stuff

gem 'pg'


# this gem is used for pagination
#gem 'kaminari'

group :production do

  #gem 'heroku-deflater' need rails 4 fix, this gem helps to optimize app performance 
  gem 'unicorn'
  gem 'rails_12factor'

end

group :development, :test do
  gem 'better_errors' #need ruby 2.0
end 

I tried to update sass rails and sprockets but of no use.I have tried to use @import fontawesome in a stylesheet other than application.css.

Upvotes: 1

Views: 694

Answers (1)

cydoc
cydoc

Reputation: 199

In my case the trouble was a result of custom fonts.

Solution was to remove the 'font' parameter from the asset-url helper.

previous:

asset-url('custom-webfont.svg', 'font') format('svg');

new

asset-url('custom-webfont.svg') format('svg');

Upvotes: 7

Related Questions