twbs / twbs/bootstrap-rubygem

ExecJS::ProgramError after adding bootstrap gem

Open
#157 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SCSS
Stars
2k
Forks
437
Avg merge
1h
Merged PRs (30d)
1

Description

After adding the bootstrap gem to my brand new Rails app and importing it in application.scss, my pages fail with

ExecJS::ProgramError in Home#index
Showing C:/Source/Repos/graph-tutorials/ruby-test/app/views/layouts/application.html.erb where line #8 raised:

identifier '(function(opts, pluginOpts) {return eval(process' undefined
Rails.root: C:/Source/Repos/graph-tutorials/ruby-test
  • Ruby 2.5.1
  • Rails 5.2.0
  • Windows 10

Steps to reproduce:

  1. Run rails new ruby-test

  2. CD to ruby-test, edit Gemfile

  3. Change sqlite3 line to load from GitHub (for Ruby 2.5 on Windows compatibility):

    gem 'sqlite3', git: 'https://github.com/sparklemotion/sqlite3-ruby'
    
  4. Run bundle install

  5. Run rails generate controller Home index

  6. Run rails server

  7. Browse to http://localhost:3000/home/index and verify the page renders

  8. Add bootstrap to Gemfile, bundle install

  9. Rename application.css to application.scss, replace contents of file with:

    // Custom bootstrap variables must be set or imported *before* bootstrap.
    @import "bootstrap";
    
  10. Restart server

  11. Browse to http://localhost:3000/home/index, see error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the listed Windows, Ruby, and Rails versions, then inspect Gemfile, app/assets/stylesheets/application.scss, and the layout entry at app/views/layouts/application.html.erb. Start with the bootstrap import and asset compilation path; done means the Home#index page renders after the import without an ExecJS::ProgramError.

Written by the indexing model from the issue text.

Assessment

Tech stack
bootstrap, rails, ruby, scss
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.