Add the following to your package.json scripts:

"preinstall": "bundle exec embeddedjs preinstall"