bootstrap-sass icon indicating copy to clipboard operation
bootstrap-sass copied to clipboard

Rails 5 alpha: valid_asset_uri?': undefined methodstart_with?' for #Regexp

Open chasik opened this issue 11 years ago • 4 comments

With run server (rails s) get error: gems/sprockets-7b913165d54b/lib/sprockets/uri_utils.rb:75:in valid_asset_uri?': undefined methodstart_with?' for #Regexp:0x00000006e76228 (NoMethodError)

valid_asset_uri? waiting string but gets rexexp from engine.rb:8

app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular.(?:eot|svg|ttf|woff2?)$)

chasik avatar Sep 03 '15 08:09 chasik

I do not know the reason ... To get rid of the errors connected https://github.com/twbs/bootstrap-rubygem - everything works well ...

chasik avatar Sep 03 '15 10:09 chasik

The cause of the error seems to be this line which adds %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff2?)$) to the assets precompile path.

At some point in the transition to Sprockets 4 adding a RegExp to the precompile list has started crashing.

tjgrathwell avatar Sep 22 '15 06:09 tjgrathwell

Apparently passing a regexp into 'precompile' is deprecated.

Relevant issues are https://github.com/rails/sprockets/issues/117 (sprockets) and https://github.com/rails/sprockets-rails/issues/269 (sprockets-rails)

It looks like this will be fixed in bootstrap-sass if #965 is accepted

tjgrathwell avatar Sep 22 '15 18:09 tjgrathwell

Merged the PR and now testing with Rails HEAD.

glebm avatar Sep 27 '15 12:09 glebm