Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5.2.1 triggers ActionView::Template::Error (undefined not callable) #166

Open
Al-un opened this issue Nov 26, 2018 · 2 comments
Open

Comments

@Al-un
Copy link

Al-un commented Nov 26, 2018

Problem

Having Rails 5.2.1, server successfully starts up but on the first page load, an error appears from my application.html.erb:

ActionView::Template::Error (undefined not callable):
     5:     <%= csrf_meta_tags %>
     6:     <%= csp_meta_tag %>
     7:
     8:     <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
     9:     <%= javascipt_include_tag 'application', 'data-turbolinks-track': 'reload' %>
    10:

(execjs):1
app/views/layouts/application.html.erb:8:in `_app_views_layouts_application_html_erb__765064803_56530640'

Configuration

From bundle list:

  • Rails 5.2.1
  • autoprefixer-rails 9.3.1
  • bootstrap 4.1.3
  • jquery-rails 4.3.3
  • sprockets 3.7.2
  • sprockets-rails 3.2.1

My application.scss has @import "bootstrap":

@import 'my-application-stuff/*';
@import 'bootstrap';
body {
  ...
}

My application.js is

//= require rails-ujs
//= require jquery
//= require activestorage
//= require turbolinks
//= require jquery3
//= require popper
//= require bootstrap-sprockets
//= require_tree .

Hints

After trying by commenting out excerpts of code and restarting, I came to the conclusion that the culprit is require 'autoprefixer-rails from engine.rb. However, I could not figure out why but when commenting this line, I can successfully load my pages with bootstrap.

Comments

My issue seems to be different from #164, hence a different issue

After seeing #162, just in case, I have Node v11.1.0 with NPM 6.4.1

@Shine18
Copy link

Shine18 commented Jan 21, 2019

Facing the same issue.
Tried installing node, but still it's giving error
screenshot_1

@Shine18
Copy link

Shine18 commented Jan 21, 2019

Solution:
After installing node, I removed duktape from my Gemfile and restart the rails server. it started working.
It's working fine now

As long as you're not using duktape (Evaluating JS in your ruby files), you're good using this bootstrap gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants