programacion pagina llamar habilitar gratis funcion evento ejecutar desde chrome cargar carga asincrona archivo antes activar javascript ruby-on-rails ruby-on-rails-3.1 v8 dreamhost

pagina - llamar funcion javascript html sin evento



No se pudo encontrar un tiempo de ejecuciĆ³n de JavaScript. Consulte https://github.com/sstephenson/execjs para obtener una lista de tiempos de ejecuciĆ³n disponibles.(ExecJS:: RuntimeUnavailable) (8)

Mi sitio web se ha roto desde que Dreamhost actualizó sus servidores hace un par de semanas. He estado tratando de arreglarlo e hice algunos progresos, pero estoy atascado en lo que es, afortunadamente, el último problema.

Estoy usando Rails 3.1.1 en Ruby 1.8.7 y me presentan una ''Error de aplicación de Ruby (Rack)'' de PhusionPassenger. Indica que ''No se pudo encontrar un tiempo de ejecución de JavaScript. Consulte https://github.com/sstephenson/execjs para obtener una lista de tiempos de ejecución disponibles. (ExecJS :: RuntimeUnavailable) ''. La búsqueda de esto en la wiki de Dreamhost ha sugerido una solución para instalar la gema ''therubyracer''.

Así que actualicé mi gemfile con la gema sugerida así:

gema ''therubyracer'', ''~> 0.9.9''

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

gema ''therubyracer'',: plataformas =>: ruby

pero no ha hecho la diferencia.

Luego paquete instalado en mi Macbook (ejecutando OS X 10.5.8) sin enganche. Sin embargo, esto falla cuando ejecuto ''cap deploy'' para poner Dreamhost; Veo un error cuando intenta instalar libv8 de lo que depende therubyracer.

¿Alguien sabe cómo instalar esto correctamente o cualquier otra solución de trabajo?

Cualquier otra información puede ser proporcionada a petición.

Comentarios de error completos de la Terminal:

  • ejecutando "cd /home/futureproof/abunchofletters.co.uk/releases/20111118003703 && bundle install --gemfile /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/ paquete --deployment --quiet --without test test "servers: [" abunchofletters.co.uk "] [abunchofletters.co.uk] ejecutando el comando ** [out :: abunchofletters.co.uk] Lamentablemente, un error fatal ha ocurrido. Informe este error al rastreador de problemas de Bundler en https://github.com/carlhuda/bundler/issues para que podamos solucionarlo. ¡Gracias! ** [out :: abunchofletters.co.uk] 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 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 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 cada ''** [out :: abunchofletters.co.uk] de /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] desde /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] de /home/futureproof/.gems/gems/ bundler-1.1.rc / lib / bundler / source.rb: 89: en la 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] desde / 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] desde /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/ installer.rb: 56: en 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] de /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] desde / 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 ejecución ''** [out :: abunchofletters.co.uk] desde / home / futureproof / .gems / gems / bundler-1.1.rc / lib / bundler / vendor / thor / invocation.rb: 118: en 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: en el 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: el comando 19 finalizó en 13170ms *** [deploy: update_code] rollingback * ejecutando "rm -rf /home/futureproof/abunchofletters.co.uk/releases/20111118003703; true "servers: [" abunchofletters.co.uk "] [abunchofletters.co.uk] ejecutando el comando de comando finalizado en 563ms error:" sh -c ''cd /home/futureproof/abunchofletters.co.uk/releases/20111118003703 && bundle instalar --gemfile /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/bundle --deployment --quiet --without development test ''"en abunchofletters.co. Reino Unido

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

Finalmente, agregue su ruta a deploy.rb, agregando la siguiente línea (en este caso, se agregan más rutas):

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"

Estás listo


Acabo de ver una presentación sobre esto.

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

Pero puedes 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úrate de gem install la gema seleccionada y luego bundle install o la bundle update para tu aplicación.

Otra nota es que también debes cambiar a 1.9.2.
Instala RVM (bash <<(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )) y puedes tener ambos 1.8.7 y 1.9.2 uno al lado del otro .


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.


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

sudo apt-get install libv8-dev

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

Puede ahorrarse un montón de problemas al implementar en Heroku, en su lugar, donde no tiene que administrar el sistema operativo o los componentes de gemas.


Si está en Ubuntu, instale nodejs

sudo apt-get install nodejs


Sugeriría instalar Nodejs . Funcionó para mí

Simplemente ve a tu terminal y escribe:

sudo apt-get install node.js

Ingrese su contraseña ... Y presione ''Y'' siempre que solicite una confirmación. Espero que esto ayude !!!


Acabo de golpear el mismo problema en mi máquina de desarrollo Win7. Parece que instalar https://github.com/hiranpeiris/therubyracer_for_windows y agregar gem ''therubyracer'' al Gemfile resuelve las cosas.

Antes de:

$ 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 básicamente significa que Rails necesita rubyracer y libv8 .

Después:

$ 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] (...)


Agrega la gema siguiente en Gemfile y prueba con la instalación del paquete

gema "therubyracer", "~> 0.10.2"