seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.5k stars 996 forks source link

Rails 4 - new project error (asset depends on glyphicons...etc) #685

Closed yourabi closed 10 years ago

yourabi commented 10 years ago

Hi

I started a new rails 4 project. Removed scss, added less and ran the bootstrap generator.

When I run: rake assets:precompile RAILS_ENV=development

I get the following

rake assets:precompile RAILS_ENV=development rake aborted! error evaluating function image-url: Asset depends on 'twitter/bootstrap/glyphicons-halflings.png' to generate properly but has not declared the dependency Please add: //= depend_on_asset "twitter/bootstrap/glyphicons-halflings.png" to '/Users/yourabi/code/snitch/snitch/app/assets/stylesheets/bootstrap_and_overrides.css.less' (in /Users/yourabi/code/snitch/snitch/app/assets/stylesheets/bootstrap_and_overrides.css.less) at /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/js/lib/less/parser.js:424:31 /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/parser.rb:100:in block in to_css' /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/java_script/v8_context.rb:90:inblock in do_lock' /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/java_script/v8_context.rb:88:in call' /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/java_script/v8_context.rb:88:inLocker' /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/java_script/v8_context.rb:88:in do_lock' /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/java_script/v8_context.rb:60:inlock' /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/java_script/v8_context.rb:30:in exec' /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/java_script.rb:26:inexec' /Users/yourabi/.gem/ruby/1.9.3/gems/less-2.4.0/lib/less/parser.rb:100:in to_css' /Users/yourabi/.gem/ruby/1.9.3/gems/less-rails-2.4.2/lib/less/rails/template_handlers.rb:19:inevaluate' /Users/yourabi/.gem/ruby/1.9.3/gems/tilt-1.4.1/lib/tilt/template.rb:103:in render' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/context.rb:197:inblock in evaluate' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/context.rb:194:in each' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/context.rb:194:inevaluate' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/processed_asset.rb:12:in initialize' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:374:innew' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:374:in block in build_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:395:incircular_call_protection' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:373:in build_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:inblock in build_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/caching.rb:58:in cache_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:inbuild_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:287:in find_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/index.rb:61:infind_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/processed_asset.rb:111:in block in resolve_dependencies' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/processed_asset.rb:105:ineach' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/processed_asset.rb:105:in resolve_dependencies' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/processed_asset.rb:97:inbuild_required_assets' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/processed_asset.rb:16:in initialize' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:374:innew' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:374:in block in build_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:395:incircular_call_protection' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:373:in build_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/index.rb:94:inblock in build_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/caching.rb:58:in cache_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:inbuild_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:287:in find_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/index.rb:61:infind_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/bundled_asset.rb:37:in init_with' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/asset.rb:24:infrom_hash' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/caching.rb:54:in cache_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/index.rb:93:inbuild_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/base.rb:287:in find_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/index.rb:61:infind_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/manifest.rb:211:in block in find_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/manifest.rb:257:inbenchmark' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/manifest.rb:210:in find_asset' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/manifest.rb:119:inblock in compile' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/manifest.rb:118:in each' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/sprockets/manifest.rb:118:incompile' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:60:in block (3 levels) in define' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-2.10.1/lib/rake/sprocketstask.rb:146:inwith_logger' /Users/yourabi/.gem/ruby/1.9.3/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define' Tasks: TOP => assets:precompile (See full trace by running task with --trace)

yourabi commented 10 years ago

So after some debugging these errors are being raised by the "sprockets_better_errors" gem (https://github.com/schneems/sprockets_better_errors) ... but that makes me think there is something wrong with this configuration that sprockets_better_errors is catching.

codespore commented 10 years ago

@yourabi Just need to update to the latest stable branch of sprockets-rails as per https://github.com/rails/rails/commit/b053a47b3e7b755d797a5185895eabcfc50b2f3b