Skip to content

Rails default Dockerfile build failed after added bootstrap gem #277

@Peredery

Description

@Peredery
  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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions