2

I am following a tutorial to install bootstrap on my rails application. I've been following this tutorial http://www.gotealeaf.com/blog/integrating-rails-and-bootstrap-part-1

Thought I run into this error, when I change my application.css to application.css.sass.

Current ExecJS runtime does't support ES5. Please install node.js.
  (in C:/Users/DanielH/Desktop/RotairApp/RubyDev/rotairapp/app/assets/stylesheets/application.css.sass)
Extracted source (around line #9):
6
7
8
9
10
11
12

   </style>

    <title>Rotair</title>
     <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
     <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
     <%= csrf_meta_tags %>
   </head>

The application css file now looks like

 @import "bootstrap-sprockets"
 @import "bootstrap"

Do I really need to install node.js?

EugZol
  • 6,476
  • 22
  • 41
MooCow
  • 1,397
  • 1
  • 12
  • 30

3 Answers3

1

You can use a CDN too. Just putt a CDN css file and JS links and you don't have to install anything.

here is the link to the files. http://www.bootstrapcdn.com/

Alireza Balouch
  • 467
  • 4
  • 13
0

The short answer is that if you want your application to serve Javascript, you need a javascript runtime. See this previous SO question. Basically Bootstrap does a lot of jQuery/JS wizardry to make things like modals work, so you have to have a JS runtime or bootstrap will not work.

You could use:

gem 'therubyracer'
gem 'execjs'

Or

node.js

I've generally had better luck with node.

Yes, you can use the CDN without the JS runtime, but you don't get the SASS variables, and can customize it.

Community
  • 1
  • 1
Chase
  • 2,748
  • 2
  • 23
  • 32
0

Installing nodeJS is all you nedd... Just restart twice... or more... Until the problem will solved itself. That worked for me.

Daniel Azamar
  • 672
  • 7
  • 8