forked from zetachang/opalrb-loader
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
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')