johnbintz/jasmine-headless-webkit — Issue #99: EJS files not loading
Author: malandrew
Created: 2011-12-21 08:24:55+00:00
State: open

I keep getting an error trying to load EJS files with jasmine-headless-webkit. I have no problems using ejs files in production or with ```rake jasmine```, but when I try running jasmine-headless-webkit I get the following error:

```
[~/code/improvisu]$ jasmine-headless-webkit
/Users/andrewdeandrade/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- ejs (LoadError)
(in /Users/andrewdeandrade/code/improvisu/app/assets/jst/ui/navigation.jst.ejs)
from /Users/andrewdeandrade/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/tilt-1.3.3/lib/tilt/template.rb:108:in `require_template_library'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/ejs_template.rb:20:in `initialize_engine'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/tilt-1.3.3/lib/tilt/template.rb:55:in `initialize'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/context.rb:174:in `new'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/context.rb:174:in `block in evaluate'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:in `each'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:in `evaluate'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:171:in `build_dependency_context_and_body'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:135:in `dependency_context'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:88:in `fresh?'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/environment.rb:70:in `find_asset'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/base.rb:110:in `[]'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:200:in `block in build_dependencies_paths_and_assets'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `each'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:88:in `fresh?'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/environment.rb:70:in `find_asset'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/base.rb:110:in `[]'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:200:in `block in build_dependencies_paths_and_assets'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `each'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:88:in `fresh?'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/environment.rb:70:in `find_asset'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/base.rb:110:in `[]'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:200:in `block in build_dependencies_paths_and_assets'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `each'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:81:in `to_a'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/jasmine-headless-webkit-0.8.4/lib/jasmine/headless/unique_asset_list.rb:10:in `collect'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/jasmine-headless-webkit-0.8.4/lib/jasmine/headless/unique_asset_list.rb:10:in `flatten'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/jasmine-headless-webkit-0.8.4/lib/jasmine/headless/files_list.rb:98:in `files'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/jasmine-headless-webkit-0.8.4/lib/jasmine/headless/files_list.rb:153:in `files_to_html'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/jasmine-headless-webkit-0.8.4/lib/jasmine/headless/template_writer.rb:15:in `write!'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/jasmine-headless-webkit-0.8.4/lib/jasmine/headless/runner.rb:80:in `run'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/jasmine-headless-webkit-0.8.4/lib/jasmine/headless/command_line.rb:18:in `run!'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/gems/jasmine-headless-webkit-0.8.4/bin/jasmine-headless-webkit:10:in `'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/bin/jasmine-headless-webkit:19:in `load'
from /Users/andrewdeandrade/.rvm/gems/ruby-1.9.3-p0@improvisu/bin/jasmine-headless-webkit:19:in `

'
```

Here is my jasmine.yml file:

```
# jasmine.yml

src_files:
- jquery-1.7.js
- lib/sinon-1.1.1.js
- lib/jasmine-sinon.js
- backbone/passive_app.js

spec_files:
- "**/*[sS]pec.js"

src_dir:
- app/assets/javascripts
- vendor/assets/javascripts
- app/assets/jst

spec_dir: spec/javascripts
```

I even went as far as forking and modifying the ruby-ejs gem to make it a Tilt module and register itself with sprockets, but that didn't fix the problem either. --> https://github.com/malandrew/ruby-ejs

Any idea why EJS templates won't load with JHW, but will load with rake jasmine or in production?