Closed sos4nt closed 7 years ago
I'm having the same issue.
⇒ RAILS_ENV=test RACK_ENV=test bundle exec rake jasmine:ci --trace
** Invoke jasmine:ci (first_time)
** Invoke jasmine:require_json (first_time)
** Execute jasmine:require_json
** Invoke jasmine:require (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute jasmine:require
** Invoke jasmine:configure (first_time)
** Execute jasmine:configure
** Invoke jasmine:configure_plugins (first_time)
** Execute jasmine:configure_plugins
** Execute jasmine:ci
Waiting for jasmine server on 56885...
Waiting for jasmine server on 56885...
Waiting for jasmine server on 56885...
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:56885, CTRL+C to stop
Waiting for jasmine server on 56885...
jasmine server started
!! Unexpected error while processing request: The asset "glyphicons-halflings.png" is not present in the asset pipeline.
^C>> Stopping ...
Same here:
Waiting for jasmine server on 56485...
Waiting for jasmine server on 56485...
Thin web server (v1.7.0 codename Dunder Mifflin)
Maximum connections set to 1024
Listening on localhost:56485, CTRL+C to stop
Waiting for jasmine server on 56485...
jasmine server started
Unexpected error while processing request: The asset "font-awesome/fontawesome-webfont.eot" is not present in the asset pipeline.``
Same here:
[2016-11-18 23:41:32] INFO WEBrick 1.3.1
[2016-11-18 23:41:32] INFO ruby 2.3.1 (2016-04-26) [x86_64-linux]
[2016-11-18 23:41:32] INFO WEBrick::HTTPServer#start: pid=16640 port=39117
Waiting for jasmine server on 39117...
jasmine server started
[2016-11-18 23:41:33] ERROR Sprockets::Rails::Helper::AssetNotFound: The asset "bootstrap/glyphicons-halflings-regular.eot" is not present in the asset pipeline.
but this only happened to my Travis CI env, tests can pass locally
I fixed this by locking to rails-sprockets 3.1.1
This worked for me, too.
It looks like Sprockets/Rails are deprecating the option to have assets in both assets
and public
, if I'm reading it correctly. Does this work if the files are in the app/assets
dir?
I'd be happy to review a pull request to set unknown_asset_fallback
to true
when the method exists to try to get around this error, but it looks like then you should just get a deprecation warning.
Thanks for using Jasmine!
I'm having the same problem and am trying to figure out a proper solution. Locking the sprockets-rails version works of course, but I'll probably like to upgrade my gems at some point.
My guess is, that there's a bug with jasmine using the assets pipeline properly and it only manifested now, because of the new sprockets behavior. I.e. it is weird that unknown_asset_fallback
has no effect, but also it shouldn't even be the case that it should need the fallback.
I think @sos4nt is correct in assuming that we need to run the action_view initializer. Because jasmine doesn't seem to trigger that, the config options are never copied and I think that might also explain, why the asset pipeline behaves weirdly in some contexts.
It looks like I was able to resolve the issue by requiring action_view/base
(thus triggering the initializer in sprockets) instead of including Sprockets::Rails::Helper
manually. If you think that's a viable solution, I'd be happy to prepare a PR :)
Note that the gem in comment https://github.com/jasmine/jasmine-gem/issues/275#issuecomment-264500651 is sprockets-rails 3.1.1
, which confused me for a little while.
I'm getting asset errors when running
bundle exec rake jasmine:ci
after updating sprockets-rails to 3.2.0:The aforementioned image is referenced in a scss file via:
And it's working fine otherwise, i.e. outside
jasmine:ci
.I've tried to debug the issue and apparently, sprockets-rails doesn't have proper config values. The above error is raised in lib/sprockets/rails/helper.rb#L82-L83:
unknown_asset_fallback
isnil
, although the default value istrue
. I don't explicitly set the value otherwise and even if I do explicitly set it totrue
, the config value doesn't find its way into the code – it remainsnil
.Further investigation shows that
Sprockets::Rails::Helper
is being included twice, once intoActionView::Base
and once into an anonymous class from withinjasmine-gem
in lib/jasmine/config.rb#L68.I'm not sure what's missing here. Maybe
jasmine-gem
has to run this callback: