twbs / twbs/bootstrap-rubygem

Rails default Dockerfile build failed after added bootstrap gem

Open
#277 12 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

  1. Create new project with importmap by default
rails new test_app
cd ../test_app
./bin/bundle add dartsass-rails
./bin/rails dartsass:install
  1. Check if build is ok
    docker build .

Now let's produce error:

  1. add bootstrap gem
    ./bin/bundle add bootstrap --git 'https://github.com/twbs/bootstrap-rubygem'
  2. build it
    docker build .

throw error:

 => ERROR [8/8] RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile                                                                 1.3s
------                                                                                                                                         
 > [8/8] RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile:                                                                            
1.256 bin/rails aborted!                                                                                                                       
1.256 ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

Installing node/etc is not the right solution because the main reason to use importmap is to drop the nodejs dependency. Any ideas on how to solve this?

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

Start by reproducing the issue with the listed rails new, dartsass:install, bootstrap gem, and docker build commands. Read the default Dockerfile and the assets:precompile failure, then determine why Bootstrap's build requires a JavaScript runtime under importmap. Done means the Docker build and asset precompile succeed without adding Node.js.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.