Matheus Souza
Matheus Souza

Reputation: 127

Ruby on Rails - Not importing SCSS

I'm making a new RoR application while trying to use the bootstrap gem but I've ran into some problems when running it for the first time. Looks like Ruby is having a hard time including the scss file

ExecJS::ProgramError in Visitor#index
Showing */app/views/layouts/guest.erb where line #8 raised:

identifier '(function(opts, pluginOpts) {return eval(process' undefined

Guest.erb

<!DOCTYPE html>
<html>
<head>
  <title>FooBar</title>
  <%= csrf_meta_tags %>
  <%= csp_meta_tag %>

  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
</head>

<body>
<%= yield %>
</body>
</html>

application.scss

 * ...........
 * It is generally better to create a new file per style scope.
 *
 */
@import "bootstrap";

Gem File

ruby '2.4.4'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
#Bootstrap
gem 'bootstrap', '~> 4.1.1'

Upvotes: 2

Views: 1170

Answers (2)

mlt
mlt

Reputation: 1669

Remove duktape gem from your Gemfile and make sure Node.js is installed or something. There should be a comment for alternatives pointing to https://github.com/rails/execjs#readme .

Upvotes: 5

Ginnie Hench
Ginnie Hench

Reputation: 377

The message, "identifier '(function(opts, pluginOpts) {return eval(process' undefined" looks like a JavaScript issue. That text matches code found here in this Rails Autoprefixer. Unfortunately, I don't know a quick fix to suggest, but since the options for that function takes file names, I'd double check to make sure there are no typos in the stylesheet file names anywhere (ie., the files themselves and wherever they might be referenced).

Upvotes: -1

Related Questions