twbs / bootstrap-sass

Official Sass port of Bootstrap 2 and 3.

Home Page:http://getbootstrap.com/css/#sass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sprockets::Rails::Helper::DependencyError

hico-horiuchi opened this issue · comments

When I run (Rails 4.1.0), Sprockets::Rails::Helper::DependencyError occurred.

Asset depends on 'bootstrap/glyphicons-halflings-regular.eot' to generate properly but has not declared the dependency
Please add: `//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"` to '/path/to/rails/vendor/bundler/ruby/2.1.0/gems/bootstrap-sass-3.1.1.0/vendor/assets/stylesheets/bootstrap.scss'
  (in /path/to/rails/vendor/bundler/ruby/2.1.0/gems/bootstrap-sass-3.1.1.0/vendor/assets/stylesheets/bootstrap.scss)

The error was resolved when the following contents add to vendor/assets/stylesheets/bootstrap.scss.

//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.svg"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.ttf"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.woff"

I also receive this error, and that workaround doesn't fix a similar error preventing me from running the rails_admin engine

@hico-horiuchi This was fixed, and will be in 3.1.2. Please use master for now.

@zezantam rails_admin is using bootstrap-sass 2, which does not have these directives. Bootstrap 2 is no longer supported, but the fix would be the same.

Looking forward to the 3.1.2 release with the fix for this error.

Following the advice to use master, got this to work by putting the following in my Gemfile:
gem 'bootstrap-sass', git: 'git@github.com:twbs/bootstrap-sass.git', ref: 'master'

ref 'master' is probably not needed.

@johnbaldwin The usual thing to do is:

gem 'bootstrap-sass', git: 'https://github.com/twbs/bootstrap-sass'

Using an https URL helps avoid issues with closed ports on tightly secured production systems.

@glebm Worked great, Thanks!

What's holding up the 3.1.2 release? Seems to be working.

@corysimmons To make life easier, bootstrap-sass releases are in sync with twbs/bootstrap. You can easily use master, or even a specific commit using ref argument.

Am I right, anyone using Rails 4.1.0 will see this error? And have to make a temporary change to their Gemfile pending release of bootstrap-sass 3.1.2? After they search the Internet to find what the error means?

@DanielKehoe Oops, I missed the release of Rails 4.1.0, thanks for calling out. I'll release 3.1.1.1 shortly (with the latest updates from upstream).

Cool. You rock.

v3.1.1.1 is out!. If this breaks for Rails 3.2 due to the changes to mixin structure from upstream, the Readme or gemspec will need to be updated to point to sprockets backport gems.

IIRC there was a problem with the old sprockets gem, which defines a custom Sass importer that does not add the current file's directory to the load path. I do not know if this is still a problem.

The workaround for this here would be messy (and involve exploding a tree of imports into a giant flat list), so the backport looks like a better solution. The official backport fixes this and many other bugs:

gem 'sprockets-rails', '=2.0.0.backport1'
gem 'sprockets', '=2.2.2.backport2'

📢 Looks like Rails 3.2 is no longer maintained for bugfixes.

@glebm Thanks 👍

@glebm Belated thanks!