programing tip

JavaScript 런타임을 찾을 수 없습니다.

itbloger 2020. 12. 28. 07:53
반응형

JavaScript 런타임을 찾을 수 없습니다. 사용 가능한 런타임 목록은 https://github.com/sstephenson/execjs를 참조하십시오. (ExecJS :: RuntimeUnavailable)


몇 주 전에 Dreamhost가 서버를 업그레이드 한 이후로 내 웹 사이트가 손상되었습니다. 나는 그것을 고치기 위해 내 머리카락을 찢어 내고 약간의 진전을 이루었지만 희망적으로 마지막 문제에 붙어 있습니다.

Ruby 1.8.7에서 Rails 3.1.1을 사용하고 있으며 PhusionPassenger에서 'Ruby (Rack) application could not be started error'라는 메시지가 표시됩니다. 'JavaScript 런타임을 찾을 수 없습니다. 사용 가능한 런타임 목록은 https://github.com/sstephenson/execjs참조 하십시오 . (ExecJS :: RuntimeUnavailable) '. Dreamhost의 wiki에서 이것을 검색하면 'therubyracer'gem을 설치하는 솔루션을 제안했습니다.

그래서 다음과 같이 제안 된 gem으로 gemfile을 업데이트했습니다.

gem 'therubyracer', '~> 0.9.9'

편집 : 또한 다음을 사용하여 파일에 추가하려고했습니다.

gem 'therubyracer', : platforms => : ruby

그러나 그것은 차이를 만들지 않았습니다.

그런 다음 Macbook (OS X 10.5.8 실행)에 문제없이 번들을 설치합니다. 그러나 Dreamhost를 설치하기 위해 'cap deploy'를 실행하면 실패합니다. Rubyracer가 의존하는 libv8을 설치하려고하면 오류가 표시됩니다.

누구나 올바르게 설치하거나 다른 작동하는 솔루션을 얻는 방법을 알고 있습니까?

다른 정보는 요청시 제공 될 수 있습니다.

터미널의 전체 오류 피드백 :

  • "cd /home/futureproof/abunchofletters.co.uk/releases/20111118003703 && bundle install --gemfile /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/ 실행 bundle --deployment --quiet --without development test "서버 : ["abunchofletters.co.uk "] [abunchofletters.co.uk] 명령 실행 ** [out :: abunchofletters.co.uk] 안타깝게도 치명적인 오류 발생했습니다. 이 오류를 https://github.com/carlhuda/bundler/issues 의 Bundler 문제 추적기에보고하여 해결할 수 있도록하십시오. 감사! ** [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] from / usr / lib / ruby / 1.8 / rubygems / installer.rb : 446 : inbuild_extensions' ** [out :: abunchofletters.co.uk] from /usr/lib/ruby/1.8/rubygems/installer.rb:198:ininstall '** [out :: abunchofletters.co.uk] from /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] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/source.rb:89:in 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] from / 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] from /home/futureproof/.gems/gems /bundler-1.1.rc/lib/bundler/installer.rb:56:in 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] from /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] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task .rb : 22 : insend' ** [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] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/invocation.rb:118:in 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:instart' ** [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:19 명령이 13170ms 만에 완료 *** [deploy : update_code] 롤백 * "rm -rf / home 실행 /futureproof/abunchofletters.co.uk/releases/20111118003703; true "서버 : ["abunchofletters.co.uk "] [abunchofletters.co.uk] 563ms 이내에 명령 명령 실행 실패 :"sh -c 'cd / home / futureproof / abunchofletters.co.uk / releases / 20111118003703 && 번들 설치 --gemfile /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/bundle --deployment- abunchofletters.co.uk의 조용한-개발 테스트없이 ' "

libv8OS 라이브러리입니다. 올바른 Linux 시스템 라이브러리를 설치해야합니다. Ubuntu를 실행중인 경우

sudo apt-get install libv8-dev

또는 http://ppa.launchpad.net/chris-lea/node.js/ubuntunode.js 와 같이 다양한 배포판을위한 Debian / Ubuntu 패키지로 제공되는 것을 설치할 수 있습니다 .

gem의 OS 나 구성 요소를 관리 할 필요가없는 대신 Heroku에 배포하면 많은 문제를 해결할 수 있습니다.


Ubuntu를 사용하는 경우 nodejs를 설치하십시오.

sudo apt-get install nodejs

저는이 보석을 자산 파이프 라인을 위해 Rails 3.1과 함께 Dreamhost에서 사용합니다.

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는 프리 컴파일러로, johnson은 런타임으로 사용합니다.

이것은 Dreamhost에서 호스팅하는 2 Rails 3.1 앱에서 작동합니다.


나는 dreamhost 공유 서버에 있습니다.

root / sudo를 사용하지 않고 nodejs를 설치했습니다. 서버에서 :

#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

다음 행을 추가하여 deploy.rb에 경로를 추가하십시오 (이 경우에는 더 많은 경로가 추가됨).

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"

완료되었습니다


방금 이것에 대한 프레젠테이션을 봤습니다.

I've used rubytheracer up till now. Apparently it ain't so great. And it's huge.

But you can use any javascript runtime.

The other two recommended are execjs and node.js (which is very hot right now).

Make sure to gem install the selected gem and then bundle install or bundle update for your app.

One other note is that you should switch to 1.9.2 also.
Install RVM (bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)) and you can have both 1.8.7 and 1.9.2 side-by-side.


I've just hit the very same problem on my Win7 dev machine. It looks like installing https://github.com/hiranpeiris/therubyracer_for_windows and adding gem 'therubyracer' to the Gemfile sorts things out.

Before:

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

This basically means that Rails needs rubyracer and libv8.

After:

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

I would suggest installing Nodejs. It worked for me.

Just go to your terminal and type in :

sudo apt-get install node.js

Enter your password...And press 'Y' whenever it asks for a confirmation. I hope this helps !!!


Add following gem in Gemfile and try with the bundle install

gem "therubyracer", "~> 0.10.2"

ReferenceURL : https://stackoverflow.com/questions/8059332/could-not-find-a-javascript-runtime-see-https-github-com-sstephenson-execjs-f

반응형