`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
apt-get install ruby1.9.3
luego, rails a la última 3.1 hay que hacerlo con gem ya que en Debian aún no está disponible
gem install rails
Pues bien, me he creado un proyecto nuevo y al ejecutar el servidor me aparece este mensaje:
$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>'
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
echo "gem 'execjs'" >> Gemfile echo "gem 'therubyracer'" >> Gemfile bundle install
Con ‘bundle install’ rails se encarga de instalar lo que necesite, en mi caso ha funcionado correctamente.


Leave a Reply