We are putting two rails 3.2.8 engines together in one rails app. The problem is that ExecJS does not like namespace for javascript_inclide_tag in layouts file. Here is the tag which causing the error:
<%= javascript_include_tag 'authentify/application' %>
Here authentify is rails engine name. The error is:
ExecJS::RuntimeError in Authentify/sessions#new
Showing C:/D/code/rails_proj/engines/authentify/app/views/layouts/sessions.html.erb where line #6 raised:
(in C:/D/code/rails_proj/engines/authentify/app/assets/javascripts/authentify/sessions.js.coffee)
Extracted source (around line #6):
3: <head>
4: <title>Login</title>
5: <%= stylesheet_link_tag "authentify/application" %>
6: <%= javascript_include_tag "authentify/application" %>
7: <%= csrf_meta_tags %>
8: </head>
9:
If we delete the namespace authentify (<%= javascript_include_tag "application" %>
), then the ExecJS error disappears and the rails app works. There is the same error for another rails engine with the js tag.
We are using windows environment. What could cause the error? Thanks for the help.
UPDATE:
In engine.rb for authentify, every js libraries are listed as:
initializer "Authentify precompile hook", :group => :all do |app|
app.config.assets.precompile += [
'authentify/application.css.scss', 'authentify/layout.css.scss', 'authentify/login.css.scss',
'authentify/paginate.css.scss', 'authentify/sessions.css.scss', 'authentify/sys_logs.css.scss',
'authentify/toolbar.css.scss', 'authentify/user_level_group_map.css', 'authentify/user_menus.css.scss',
'authentify/users.css.scss', 'authentify/application.js', 'authentify/sessions.js.coffee',
'authentify/sys_logs.js.coffee', 'authentify/user_level_group_map.js', 'authentify/user_menus.js.coffee',
'authentify/users.js']
end