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

Una de ruby + rails en Debian wheezy.
Estoy tocando ruby on rails de nuevo y al actualizar rails en debian he tenido que hacer unos retoques en la instalación.

Lo primero es instalar ruby1.9.3
[shell]
apt-get install ruby1.9.3
[/shell]

luego, rails a la última 3.1 hay que hacerlo con gem ya que en Debian aún no está disponible

[shell]
gem install rails
[/shell]

Pues bien, me he creado un proyecto nuevo y al ejecutar el servidor me aparece este mensaje:
[shell]
$rails server
/var/lib/gems/1.9.1/gems/execjs-1.2.12/lib/execjs/runtimes.rb:47:in `autodetect’: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /var/lib/gems/1.9.1/gems/execjs-1.2.12/lib/execjs.rb:5:in `<module:ExecJS>’
from /var/lib/gems/1.9.1/gems/execjs-1.2.12/lib/execjs.rb:4:in `<top (required)>’
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require’
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require’
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each’
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require’
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each’
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require’
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:122:in `require’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:52:in `require’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:52:in `block in <top (required)>’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `<top (required)>’
from script/rails:6:in `require’
from script/rails:6:in `<main>’
[/shell]
Como hace mucho que no toco rails y ha cambiado bastante me he ido a buscar a google y encontré este enlace : http://www.ruby-forum.com/topic/1899392

La solución en mi caso ha sido moficando el fichero Gemfile
[shell]
echo «gem ‘execjs’» >> Gemfile
echo «gem ‘therubyracer’» >> Gemfile
bundle install
[/shell]

Con ‘bundle install’ rails se encarga de instalar lo que necesite, en mi caso ha funcionado correctamente.


Publicado

en

por

Etiquetas:

Comentarios

2 respuestas a «`autodetect’: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)»

  1. Avatar de Juan Carlos Canaza

    Gracias justo retome ruby y me encontré con el mismo problema

  2. Avatar de writkas

    gracias, me paso lo mismo y me solucionó el problema 🙂

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.