File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class LanguagePack::Ruby < LanguagePack::Base
2121 LEGACY_JVM_VERSION = "openjdk1.7.0_25"
2222 DEFAULT_RUBY_VERSION = "ruby-2.0.0"
2323 RBX_BASE_URL = "http://binaries.rubini.us/heroku"
24+ NODE_BP_PATH = "vendor/node/bin"
2425
2526 # detects if this is a valid Ruby app
2627 # @return [Boolean] true if it's a Ruby app
@@ -219,6 +220,7 @@ def ruby_versions
219220 def setup_language_pack_environment
220221 instrument 'ruby.setup_language_pack_environment' do
221222 setup_ruby_install_env
223+ ENV [ "PATH" ] += ":#{ node_bp_bin_path } " if node_js_installed?
222224
223225 # TODO when buildpack-env-args rolls out, we can get rid of
224226 # ||= and the manual setting below
@@ -683,7 +685,15 @@ def add_dev_database_addon
683685 # @note execjs will blow up if no JS RUNTIME is detected and is loaded.
684686 # @return [Array] the node.js binary path if we need it or an empty Array
685687 def add_node_js_binary
686- bundler . has_gem? ( 'execjs' ) ? [ NODE_JS_BINARY_PATH ] : [ ]
688+ bundler . has_gem? ( 'execjs' ) && !node_js_installed? ? [ NODE_JS_BINARY_PATH ] : [ ]
689+ end
690+
691+ def node_bp_bin_path
692+ "#{ Dir . pwd } /#{ NODE_BP_PATH } "
693+ end
694+
695+ def node_js_installed?
696+ @node_js_installed ||= run ( "node -v" , env : { "PATH" => "#{ node_bp_bin_path } :#{ ENV [ "PATH" ] } " } ) && $?. success?
687697 end
688698
689699 def run_assets_precompile_rake_task
You can’t perform that action at this time.
0 commit comments