Skip to main content

Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)


My website has been broken since Dreamhost upgraded their servers a couple of weeks ago. I have been tearing my hair out trying to get it fixed and made some progress but am stuck on what is hopefully the final issue.



I'm using Rails 3.1.1 on Ruby 1.8.7 and get presented with a 'Ruby (Rack) application could not be started error' from PhusionPassenger. It states that it 'Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)'. Searching for this on Dreamhost's wiki has suggested a solution to install 'therubyracer' gem.



So I updated my gemfile with the suggested gem like so:




gem 'therubyracer', '~> 0.9.9'




EDIT: I have also tried adding to the file with:




gem 'therubyracer', :platforms => :ruby




but it hasn't made a difference.



Then bundle installed on my Macbook (running OS X 10.5.8) without hitch. However, this fails when I run 'cap deploy' to put on Dreamhost; I see an error when it attempts to install libv8 which therubyracer depends on.



Anyone know how to get this to install correctly or any other working solution?



Any other info can be provided upon request.



Full error feedback from Terminal:




  • executing "cd /home/futureproof/abunchofletters.co.uk/releases/20111118003703 && bundle install --gemfile /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/bundle --deployment --quiet --without development test" servers: ["abunchofletters.co.uk"] [abunchofletters.co.uk] executing command ** [out :: abunchofletters.co.uk] Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! ** [out :: abunchofletters.co.uk] /usr/lib/ruby/1.8/rubygems/installer.rb:483:in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) ** [out :: abunchofletters.co.uk] ** [out :: abunchofletters.co.uk] /usr/bin/ruby1.8 extconf.rb ** [out :: abunchofletters.co.uk] *** extconf.rb failed *** ** [out :: abunchofletters.co.uk] Could not create Makefile due to some reason, probably lack of ** [out :: abunchofletters.co.uk] necessary libraries and/or headers. Check the mkmf.log file for more ** [out :: abunchofletters.co.uk] details. You may need configuration options. ** [out :: abunchofletters.co.uk] ** [out :: abunchofletters.co.uk] Provided configuration options: ** [out :: abunchofletters.co.uk] --with-opt-dir ** [out :: abunchofletters.co.uk] --without-opt-dir ** [out :: abunchofletters.co.uk] --with-opt-include ** [out :: abunchofletters.co.uk] --without-opt-include=${opt-dir}/include ** [out :: abunchofletters.co.uk] --with-opt-lib ** [out :: abunchofletters.co.uk] --without-opt-lib=${opt-dir}/lib ** [out :: abunchofletters.co.uk] --with-make-prog ** [out :: abunchofletters.co.uk] --without-make-prog ** [out :: abunchofletters.co.uk] --srcdir=. ** [out :: abunchofletters.co.uk] --curdir ** [out :: abunchofletters.co.uk] --ruby=/usr/bin/ruby1.8 ** [out :: abunchofletters.co.uk] extconf.rb:13: uninitialized constant Gem (NameError) ** [out :: abunchofletters.co.uk] Checking for Python... ** [out :: abunchofletters.co.uk] ** [out :: abunchofletters.co.uk] Gem files will remain installed in /home/futureproof/.gems/bundle/ruby/1.8/gems/libv8-3.3.10.4 for inspection. ** [out :: abunchofletters.co.uk] Results logged to /home/futureproof/.gems/bundle/ruby/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out ** [out :: abunchofletters.co.uk] from /usr/lib/ruby/1.8/rubygems/installer.rb:446:in each' ** [out :: abunchofletters.co.uk] from /usr/lib/ruby/1.8/rubygems/installer.rb:446:in build_extensions' ** [out :: abunchofletters.co.uk] from /usr/lib/ruby/1.8/rubygems/installer.rb:198:in install' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/source.rb:90:in install' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:78:in preserve_paths' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/source.rb:89:in install' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:73:in install_gem_from_spec' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:93:in with_build_args' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:72:in install_gem_from_spec' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:56:in run' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:55:in run' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:12:in install' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/cli.rb:219:in install' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:in send' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:in run' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor.rb:263:in dispatch' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/base.rb:386:in start' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/bin/bundle:13 ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/bin/bundle:19:in load' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/bin/bundle:19 command finished in 13170ms * [deploy:update_code] rolling back * executing "rm -rf /home/futureproof/abunchofletters.co.uk/releases/20111118003703; true" servers: ["abunchofletters.co.uk"] [abunchofletters.co.uk] executing command command finished in 563ms failed: "sh -c 'cd /home/futureproof/abunchofletters.co.uk/releases/20111118003703 && bundle install --gemfile /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/bundle --deployment --quiet --without development test'" on abunchofletters.co.uk



Source: Tips4allCCNA FINAL EXAM

Comments

  1. If you're on Ubuntu, install nodejs

    sudo apt-get install nodejs

    ReplyDelete
  2. i use this gems on Dreamhost with Rails 3.1 for the Asset Pipeline

    group :assets do
    gem 'execjs'
    gem 'therubyracer', :platforms => :ruby
    gem 'johnson'
    gem 'sass-rails', " ~> 3.1.0"
    gem 'coffee-rails', "~> 3.1.0"
    gem 'uglifier'
    end


    therubyracer as precompiler, and johnson as runtime.

    This work for me in 2 Rails 3.1 apps hosted by Dreamhost.

    ReplyDelete
  3. I just a saw a presentation on this.

    I've used rubytheracer up till now. Apparently it ain't so great. And it's huge.

    But you can use any javascript runtime.

    The other two recommended are execjs and node.js (which is very hot right now).

    Make sure to gem install the selected gem and then bundle install or bundle update for your app.

    One other note is that you should switch to 1.9.2 also.
    Install RVM (bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer))
    and you can have both 1.8.7 and 1.9.2 side-by-side.

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex