Nie można znaleźć środowiska uruchomieniowego JavaScript. Zobacz też https://github.com/sstephenson/execjs aby uzyskać listę dostępnych czasów uruchamiania. (ExecJS:: RuntimeUnavailable)

Moja strona została uszkodzona od czasu aktualizacji Dreamhost kilka tygodni temu. Byłem łzawienie moje włosy, próbując go naprawić i poczynił pewne postępy, ale utknąłem na tym, co mam nadzieję, że ostateczna kwestia.

Używam Rails 3.1.1 na Rubim 1.8.7 i otrzymuję prezentację "błąd uruchomienia aplikacji Ruby (Rack)" od PhusionPassenger. Stwierdza, że " nie można znaleźć środowiska uruchomieniowego JavaScript. Zobacz https://github.com/sstephenson/execjs dla listy dostępnych czasów uruchomienia. (ExecJS:: RuntimeUnavailable)". Szukając tego na wiki Dreamhost zasugerował rozwiązanie do zainstalowania klejnotu 'therubyracer'.

Więc zaktualizowałem mój gemfile o sugerowany gem tak:

Gem 'therubyracer', '~> 0.9.9'

EDIT: próbowałem też dodać do pliku:

Gem 'therubyracer',: platforms=>: ruby

Ale to nic nie zmieniło.

Następnie pakiet zainstalowany na moim Macbook (z systemem OS X 10.5.8) bez zaczepu. Jednak to nie powiedzie się, gdy uruchamiam 'Cap deploy', aby umieścić na Dreamhost; widzę błąd, gdy próbuje zainstalować libv8, od którego zależy therubyracer.

Ktoś wie jak to poprawnie zainstalować lub inne działające rozwiązanie?

Wszelkie inne informacje mogą być dostarczone na życzenie.

Pełna informacja zwrotna o błędzie z terminala:

  • " CD /home/futureproof/abunchofletters.co.uk/releases/2011118003703 && bundle install --gemfile /home / futureproof/abunchofletters. co. uk / releases/2011118003703/Gemfile -- path / home / futureproof/.gems / bundle --deployment --quiet -- without development test" serwery: ["abunchofletters.co.uk"] [abunchofletters.co.uk] wykonanie polecenia ** [out :: abunchofletters.co.uk] niestety wystąpił błąd krytyczny. Prosimy o zgłoszenie tego błędu w aplikacji Bundler issue tracker pod adresem https://github.com/carlhuda/bundler/issues żebyśmy mogli to naprawić. Dzięki! ** [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:ineach ' * * [out :: abunchofletters.co.uk] od /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] od / home / futureproof/gems/gems/bundler-1.1.rc / lib/bundler / źródło.rb: 90: w 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] od / home / futureproof/gems/gems/bundler-1.1.rc / lib/bundler / źródło.rb: 89: w 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] od / home / futureproof/gems/gems/bundler-1.1.rc/lib/bundler / rubygems_integration.rb: 93: w 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] od / home / futureproof/gems/gems/bundler-1.1.rc / lib/bundler / installer.rb: 56: w 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] od / home / futureproof/gems/gems/bundler-1.1.rc / lib/bundler / installer.rb: 12: W 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] od / home / futureproof/gems/gems/bundler-1.1.rc / lib/bundler/vendor/thor / task.rb: 22: w 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] od / home / futureproof/gems/gems/bundler-1.1.rc / lib/bundler/vendor/thor / invocation.rb: 118: w 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] od / home / futureproof/gems/gems/bundler-1.1.rc / lib/bundler/vendor/thor / base.rb: 386: w 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] od / home / futureproof/gems / bin / bundle:19 Komenda zakończona w 13170ms *** [deploy:update_code] rolling back * executing " rm-rf / home / futureproof/abunchofletters. co. uk/releases / 20111118003703; true" serwery: ["abunchofletters.co.uk"] [abunchofletters.co.uk] wykonywanie polecenia command finished in 563ms failed: "Sh-C 'cd /home/futureproof/abunchofletters.co.uk/releases / 20111118003703 && bundle install --gemfile /home / futureproof/abunchofletters. co. uk / releases/2011118003703/Gemfile -- path / home / futureproof/.gems / bundle --deployment --quiet -- without test rozwojowy" " na abunchofletters.co.uk
Author: Michael Durrant, 2011-11-09

8 answers

libv8 jest biblioteką systemu operacyjnego; musisz zainstalować odpowiednią bibliotekę systemu Linux. Jeśli używasz Ubuntu, to jest to

sudo apt-get install libv8-dev

Alternatywnie możesz zainstalować node.js, który jest dostępny jako pakiet Debian/Ubuntu dla różnych dystrybucji, np. http://ppa.launchpad.net/chris-lea/node.js/ubuntu

Możesz zaoszczędzić sobie wiele kłopotów, instalując Heroku zamiast tego, gdzie nie musisz zarządzać systemem operacyjnym lub komponentami dla klejnotów.

 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/doraprojects.net/template/agent.layouts/content.php on line 54
2012-02-15 09:01:52

Jeśli korzystasz z Ubuntu, zainstaluj 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/doraprojects.net/template/agent.layouts/content.php on line 54
2012-03-11 14:47:33

Używam tego klejnotu na Dreamhost z Rails 3.1 Dla Asset Pipeline

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 jako precompiler, a johnson jako runtime.

To działa dla mnie w aplikacjach 2 Rails 3.1 hostowanych przez 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/doraprojects.net/template/agent.layouts/content.php on line 54
2011-12-01 23:39:54

Jestem w DreamHost shared server.

Zainstalowałem nodejs bez użycia root / sudo. Na serwerze:

#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 dodaj swoją ścieżkę do wdrożenia.rb, dodanie następującej linii (w tym przypadku dodano kilka ścieżek):

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"

Jesteś skończony

 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/doraprojects.net/template/agent.layouts/content.php on line 54
2012-12-19 12:09:51

Właśnie widziałem prezentację na ten temat.

Używałem rubytheracer do tej pory. Najwyraźniej nie jest tak dobrze. I jest ogromny.

Ale możesz użyć dowolnego środowiska javascript.

Pozostałe dwa zalecane to execjs i node.js (co jest teraz bardzo gorące).

Upewnij się, że gem install wybrany gem, a następnie bundle install lub bundle update dla Twojej aplikacji.

Jeszcze jedna uwaga jest taka, że powinieneś również przełączyć się na 1.9.2.
Install RVM (bash https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )) i możesz mieć zarówno 1.8.7 jak i 1.9.2 obok siebie.

 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/doraprojects.net/template/agent.layouts/content.php on line 54
2011-11-18 01:42:30

Właśnie trafiłem na ten sam problem na mojej maszynie Win7 dev. Wygląda jak instalacja https://github.com/hiranpeiris/therubyracer_for_windows i dodanie gem 'therubyracer' do Gemfile sortuje rzeczy.

Przed:

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

To w zasadzie oznacza, że Rails potrzebuje rubyracer i libv8.

Po:

$ 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/doraprojects.net/template/agent.layouts/content.php on line 54
2013-02-22 13:43:55

Sugerowałbym zainstalowanie Nodejs . U mnie zadziałało.

Po prostu przejdź do terminala i wpisz:

Sudo apt-get install node.js

Wprowadź hasło...I naciśnij "Y", gdy poprosi o potwierdzenie. Mam nadzieję, że to pomoże !!!

 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/doraprojects.net/template/agent.layouts/content.php on line 54
2012-07-21 09:19:37

Dodaj następujący gem w Gemfile i spróbuj zainstalować pakiet

Gem "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/doraprojects.net/template/agent.layouts/content.php on line 54
2014-10-11 04:29:25