Skip to content

Bundler based compilers do not auto require #31

@wied03

Description

@wied03

When using a Bundler based environment, load paths, etc. come in from Bundler auto requires.

When a compiler is built from the Bundler Opal version, Bundler.require is not issued in order to get any Opal compiler patches GEMs may apply.

Workaround is to use something like this:

const env = process.env
const path = require('path')

const requireDepLoadPath = path.join(require('child_process').execSync("ruby -e \"puts Gem::Specification.find_by_name('opal-require-dep').gem_dir\"").toString().trim(), 'lib')
env.OPAL_COMPILER_LOAD_PATH = requireDepLoadPath
env.OPAL_COMPILER_REQUIRES = path.join(requireDepLoadPath, 'opal-require-dep')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions