No se pudo encontrar un tiempo de ejecución de JavaScript. Véase https://github.com/sstephenson/execjs para una lista de tiempos de ejecución disponibles. (ExecJS:: RuntimeUnavailable)


Mi sitio web se ha roto desde que Dreamhost actualizó sus servidores hace un par de semanas. He estado arrancándome el pelo tratando de arreglarlo e hice algunos progresos, pero estoy atascado en lo que espero sea el problema final.

Estoy usando Rails 3.1.1 en Ruby 1.8.7 y se me presenta un 'error de no se pudo iniciar la aplicación Ruby (Rack)' de PhusionPassenger. Afirma que no pudo encontrar un tiempo de ejecución de JavaScript. Véase https://github.com/sstephenson/execjs para una lista de tiempos de ejecución disponibles. (ExecJS:: RuntimeUnavailable)". Buscando esto en el wiki de Dreamhost ha sugerido una solución para instalar la gema' therubyracer'.

Así que actualizé mi gemfile con la gema sugerida de la siguiente manera:

Gem'therubyracer', '~> 0.9.9'

EDITAR: También he intentado agregar al archivo con:

Gem 'therubyracer',: platforms=>: ruby

Pero no ha hecho ninguna diferencia.

Luego bundle instalado en mi Macbook (con OS X 10.5.8) sin problemas. Sin embargo, esto falla cuando corro 'cap deploy' para poner en Dreamhost; veo un error cuando intenta instalar libv8 del que depende therubyracer.

¿Alguien sabe cómo hacer que esto se instale correctamente o cualquier otra solución que funcione?

Se puede proporcionar cualquier otra información previa solicitud.

Retroalimentación de error completa de Terminal:

  • ejecutando " cd / home / futureproof / abunchofletters. co. uk/releases / 20111118003703 && bundle install gem gemfile /home/futureproof / abunchofletters. co. uk/releases / 20111118003703 / Gemfile -- path / inicio / futureproof/.gems / bundle deployment deployment quiet quiet without sin pruebas de desarrollo" servidores: ["abunchofletters.co.uk"] [abunchofletters.co.uk] ejecutar comando * * [out :: abunchofletters.co.uk] Desafortunadamente, ha ocurrido un error fatal. Por favor, informe de este error al Bundler issue tracker en https://github.com/carlhuda/bundler/issues para que podamos arreglarlo. ¡Gracias! ** [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:ininstall ' * *[out :: abunchofletters.co.uk] from / home / futureproof/.gemas/gemas / 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/.gemas/gemas / 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/.gemas/gemas / 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/.gemas/gemas / 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/.gemas/gemas / 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/.gemas/gemas / 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/.gemas/gemas / 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/.gemas/gemas / 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 comando terminado en 13170ms *** [deploy:update_code] rolling back * executing " rm-rf/home/futureproof/abunchofletters.co.uk/releases / 20111118003703; true" servidores: ["abunchofletters.co.uk"] [abunchofletters.co.uk] orden de ejecución el comando terminado en 563ms falló: "sh-c 'cd /home/futureproof/abunchofletters.co.uk/releases/20111118003703 && bundle install gem gemfile /home/futureproof / abunchofletters. co. uk/releases / 20111118003703 / Gemfile -- path / inicio / futureproof/.gemas / paquete deployment despliegue quiet silencioso without sin prueba de desarrollo '" en abunchofletters.co.uk
Author: Michael Durrant, 2011-11-09

8 answers

libv8 es una biblioteca del sistema operativo; necesitará instalar la biblioteca del sistema Linux correcta. Si estás ejecutando Ubuntu, es

sudo apt-get install libv8-dev

Alternativamente, puede instalar node.js que está disponible como un paquete Debian/Ubuntu para varias distribuciones, por ejemplo, http://ppa.launchpad.net/chris-lea/node.js/ubuntu

Puede ahorrarse muchos problemas implementando en Heroku, donde no tiene que administrar el sistema operativo o los componentes de las gemas.

 33
Author: Wolfram Arnold,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-02-15 09:01:52

Si estás en Ubuntu, instala nodejs

sudo apt-get install nodejs
 122
Author: Jim Clouse,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-03-11 14:47:33

Utilizo estas gemas en Dreamhost con Rails 3.1 para la Canalización de activos

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 como precompilador, y johnson como tiempo de ejecución.

Esto funciona para mí en 2 aplicaciones Rails 3.1 alojadas por Dreamhost.

 10
Author: Manuel Betancourt Garza,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-12-01 23:39:54

Estoy en el servidor compartido de dreamhost.

Instalé nodejs sin usar root/sudo. En el servidor:

#download node js (check last version from web)
$ wget http://nodejs.org/dist/v0.8.16/node-v0.8.16-linux-x86.tar.gz
#untar
$ tar xzf node-v0.8.16-linux-x86.tar.gz

Finnaly añade su ruta al deploy.rb, añadiendo la siguiente línea (en este caso se añaden algunas rutas más):

default_environment["PATH"] = ":/home/myUser/soft/node-v0.8.16-linux-x86/bin:/home/myUser/.gems/bin:/usr/lib/ruby/gems/1.8/bin/:$PATH"

Has terminado

 5
Author: Mateu,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-12-19 12:09:51

Acabo de ver una presentación sobre esto.

He usado rubytheracer hasta ahora. Aparentemente no es tan genial. Y es enorme.

Pero puede usar cualquier tiempo de ejecución de javascript.

Los otros dos recomendados son execjs y node.js (que está muy caliente en este momento).

Asegúrese de gem install la gema seleccionada y luego bundle install o bundle update para su aplicación.

Otra nota es que también debes cambiar a 1.9.2.
Instalar RVM (bash https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )) y usted puede tener tanto 1.8.7 y 1.9.2 lado a lado.

 1
Author: Michael Durrant,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-11-18 01:42:30

Acabo de golpear el mismo problema en mi máquina Win7 dev. Parece instalar https://github.com/hiranpeiris/therubyracer_for_windows y añadiendo gem 'therubyracer' al Gemfile ordena las cosas.

Antes:

$ rails generate
c:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
(...)

Esto significa básicamente que Rails necesita rubyracer y libv8.

Después de:

$ rails generate
    SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
    This poses a security threat. It is strongly recommended that you
    provide a secret to prevent exploits that may be possible from crafted
    cookies. This will not be supported in future versions of Rack, and
    future versions will even invalidate your existing user cookies.

    Called from: c:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.

Usage: rails generate GENERATOR [args] [options]
(...)
 1
Author: Jakub Czaplicki,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-02-22 13:43:55

Yo sugeriría instalar Nodejs. Funcionó para mí.

Simplemente vaya a su terminal y escriba :

Sudo apt-get install node.js

Introduzca su contraseña...Y pulse ' Y ' cada vez que pida una confirmación. Espero que esto ayude !!!

 0
Author: Sri Murthy Upadhyayula,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-07-21 09:19:37

Agregue la siguiente gema en Gemfile y pruebe con el bundle install

Gema "therubyracer", "~> 0.10.2"

 0
Author: rahul patil,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-10-11 04:29:25