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

Sprockets::Rails::Helper::DependencyError #578

Closed
hico-horiuchi opened this issue Apr 9, 2014 · 15 comments
Closed

Sprockets::Rails::Helper::DependencyError #578

hico-horiuchi opened this issue Apr 9, 2014 · 15 comments

Comments

@hico-horiuchi
Copy link

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)
@hico-horiuchi
Copy link
Author

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"

@zezantam
Copy link

zezantam commented Apr 9, 2014

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

@glebm
Copy link
Member

glebm commented Apr 9, 2014

@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.

@DanielKehoe
Copy link

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

@johnbaldwin
Copy link

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.

@glebm
Copy link
Member

glebm commented Apr 16, 2014

@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.

@johnbaldwin
Copy link

@glebm Worked great, Thanks!

@corysimmons
Copy link

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

@glebm
Copy link
Member

glebm commented Apr 18, 2014

@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.

@DanielKehoe
Copy link

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?

@glebm
Copy link
Member

glebm commented Apr 18, 2014

@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).

glebm added a commit that referenced this issue Apr 18, 2014
This is to fix a compatibility issue with sprockets + Rails >= 4.1.0, released on Apr 8.
See #578
@DanielKehoe
Copy link

Cool. You rock.

@glebm
Copy link
Member

glebm commented Apr 18, 2014

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.

@corysimmons
Copy link

@glebm Thanks 👍

glebm added a commit that referenced this issue Apr 19, 2014
@johnbaldwin
Copy link

@glebm Belated thanks!

rroblak pushed a commit to insight-meditation-center/imc-bootstrap-sass that referenced this issue Nov 9, 2015
This is to fix a compatibility issue with sprockets + Rails >= 4.1.0, released on Apr 8.
See twbs/bootstrap-sass#578
bluedone added a commit to bluedone/bootstrap-rubygem that referenced this issue Jun 6, 2023
This is to fix a compatibility issue with sprockets + Rails >= 4.1.0, released on Apr 8.
See twbs/bootstrap-sass#578
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

6 participants