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

Monday, December 12th, 2011 @ 12:52 am | ruby

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

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

 

Recently

  • iconv-column-converter
  • Cómo instalar dropbox en Debian usando los sources , copia y pega
  • Infección en apps de Android
  • virt-manager: ERROR:root:unsupported locale setting
  • sopastrike.com – Vamos a la huelga
  • No me gusta wordpress
  • [Asterisk] Tareas de mantenimiento
  • screengrab queda muerto
  • rails + omniauth + omniauth-twitter
  • Ruby on Rails + Papercliip: cannot load such file — cocaine (LoadError)
  •