Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8159427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:54:30+00:00 2026-06-06T17:54:30+00:00

I try to create a simple heroku app which clones a git repository, invokes

  • 0

I try to create a simple heroku app which clones a git repository, invokes bundle install, a rake dist task and then uploads the created files to a GitHub repository. The build task of the cloned repository uses Rake Pipeline, which uses the execjs gem for building the binary.

I’ve created a sample app located at https://github.com/pangratz/github-uploader-test, which illustrates the problem. The directory structure of the application is the following:

/upload.rb
/project
   Rakefile
   Assetfile
   Gemfile
   Gemfile.lock

The app itself is a simple sinatra app with a get '/' route, which looks like this:

upload.rb

get '/' do
  Dir.chdir "project" do
    Bundler.with_clean_env do
      system "bundle install"
      system "bundle exec rake dist"
    end
  end
end

For demonstration purpose, the project folder simulates the cloned git repository. It contains a Rakefile, Assetfile, Gemfile and Gemfile.lock.

project/Rakefile

desc "Build"
task :dist do
  Rake::Pipeline::Project.new("Assetfile").invoke
end

project/Assetfile

require "rake-pipeline-web-filters"
require "json"
require "uglifier"
require "execjs"

puts ExecJS.eval "'red yellow blue'.split(' ')"

project/Gemfile

source "http://rubygems.org"

gem "rake-pipeline", :git => "https://github.com/livingsocial/rake-pipeline.git"
gem "rake-pipeline-web-filters", :git => "https://github.com/wycats/rake-pipeline-web-filters.git"
gem "colored"
gem "uglifier", :git => "https://github.com/lautis/uglifier.git"

group :development do
  gem "rack"
  gem "rest-client"
  gem "github_api"
  gem "ember-docs", :git => "https://github.com/emberjs/docs-generator.git"
  gem "kicker"
end

The invocation of bundle install seems to work. The problem is that rake dist is failing with the error Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes..

The heroku app itself is created with the option --stack cedar.

I’ve also created a route ‘/test’ which uses Execjs and this does not fail. So it seems
that there is a problem with the Bundler.with_clean_env and not finding the installed JavaScript Runtime …

upload.rb

get '/test' do
  puts ExecJS.eval "'red yellow blue'.split(' ')"
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:54:33+00:00Added an answer on June 6, 2026 at 5:54 pm

    I’ve opened an issue on Heroku and I could solve the issue. The problem was that the Dir.chdir("project") in combination with the Bundler.with_clean_env resulted in an invalid PATH which is needed to locate the JavaScript Runtime. Long story short, here is the working solution:

    get '/' do
      Dir.chdir "project" do
        Bundler.with_clean_env do
          ENV["PATH"] = "/app/bin:#{ENV['PATH']}"
          system "bundle install --without WATWAT"
          system "bundle exec rake dist"
        end
      end
    end
    

    A note on the solution: the --without WATWAT is needed because Heroku installs your app with bundle install --without development. Since the --without is remembered for successive calls, and the gems of development group are needed in the Assetfile, this option has to be overwritten. Using --without '' somehow doesn’t work so I’m using the nonexistent group WATWAT to include all groups in the Gemfile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my Silverlight 4 app, I try to create a simple UserControl, which will
I try to create a very simple app using windows API. I've done some
I am trying to create a simple C# app which does port forwarding, and
I'm new to Java and Android development and try to create a simple app
Alright, I'll try and make this as simple as possible. I'm trying to create
I have created an App on Heroku which works perfectly in a Web Browser.
I've successfully created a simple app and push it to Heroku. In the first
I want to create simple equalizer for android. How can I do it? Try
I try to create simple web service with CXF, Jetty and Spring. I create
i'm a newbie in.net and im try to create a simple site. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.