2011-11-09 10 views
53

मेरी वेबसाइट टूटी हुई है क्योंकि ड्रीमहोस्ट ने कुछ हफ्ते पहले अपने सर्वर को अपग्रेड किया था। मैं अपने बालों को फाड़ने और इसे कुछ प्रगति करने की कोशिश कर रहा हूं, लेकिन उम्मीद है कि आखिरी मुद्दा क्या है।एक जावास्क्रिप्ट रनटाइम नहीं मिला। उपलब्ध रनटाइम्स की सूची के लिए https://github.com/sstephenson/execjs देखें। (ExecJS :: रनटाइम अनुपलब्ध)

मैं रूबी 1.8.7 पर रेल 3.1.1 का उपयोग कर रहा हूं और फ़्यूज़न पैसेंजर से 'रूबी (रैक) एप्लिकेशन को त्रुटि शुरू नहीं की जा सकती है। यह बताता है कि 'जावास्क्रिप्ट रनटाइम नहीं मिला। उपलब्ध रनटाइम्स की सूची के लिए https://github.com/sstephenson/execjs देखें। (ExecJS :: RuntimeUnavailable) '। ड्रीमहोस्ट के विकी पर इसके लिए खोज करने से 'थर्म्यूराइज़र' मणि स्थापित करने का एक समाधान सुझाया गया है।

तो मैं तो जैसे सुझाव दिया मणि के साथ मेरी gemfile अद्यतन:

मणि 'therubyracer', '~> 0.9.9'

संपादित करें: मैं भी फ़ाइल को जोड़ने की कोशिश की है साथ:

मणि 'therubyracer',: प्लेटफार्मों =>: रूबी

लेकिन इससे कोई फर्क नहीं पड़ता है।

फिर मेरी मैकबुक (ओएस एक्स 10.5.8 चल रहा है) पर बिना बंडल के बंडल स्थापित किया गया। हालांकि, यह विफल रहता है जब मैं Dreamhost पर रखने के लिए 'टोपी तैनाती' चलाता हूं; मुझे एक त्रुटि दिखाई देती है जब यह libv8 स्थापित करने का प्रयास करता है जो थर्म्यूराइज़र पर निर्भर करता है।

कोई भी जानता है कि यह सही तरीके से या किसी अन्य कामकाजी समाधान को स्थापित करने के लिए कैसे प्राप्त किया जाए?

अनुरोध पर कोई अन्य जानकारी प्रदान की जा सकती है। टर्मिनल से

पूर्ण त्रुटि प्रतिक्रिया:

  • क्रियान्वित "सीडी /home/futureproof/abunchofletters.co.uk/releases/20111118003703 & & बंडल --gemfile स्थापित/घर// abunchofletters futureproof .co.uk/रिलीज/20111118003703/जेमफाइल --पथ/होम/फ्यूचरप्रूफ /.gems/bundle --deployment --quiet - विकास परीक्षण के बिना " सर्वर: [" abunchofletters.co.uk "] [abunchofletters .co.uk] निष्पादन आदेश ** [out :: abunchofletters.co.uk] दुर्भाग्यवश, एक घातक त्रुटि हुई है। कृपया इस त्रुटि को बंडलर इश्यू ट्रैकर को https://github.com/carlhuda/bundler/issues पर रिपोर्ट करें ताकि हम इसे ठीक कर सकें। धन्यवाद! ** [आउट :: abunchofletters.co.uk] /usr/lib/ruby/1.8/rubygems/installer.rbodev83: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 प्रत्येक '** [आउट :: abunchofletters.co.uk] /usr/lib/ruby ​​/ 1.8/rubygems/installer.rb: 446: build_extensions' ** [out :: abunchofletters.co.uk] from /usr/lib/ruby/1.8/rubygems/installer.rb:198:in /home/futureproof/.gems/gems/bundler-1.1.rc से '** [आउट :: abunchofletters.co.uk] इंस्टॉल करें /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] /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/ से Source.rb: 89: 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] /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/rubygems_integration से।आरबी: 9 3: 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] /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 रन '** [बाहर :: abunchofletters.co.uk] /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 से स्थापित' * * [आउट :: abunchofletters.co.uk] /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 रन '** [आउट :: abunchofletters.co.uk] /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 प्रेषण '** [ बाहर :: abunchoflett ers.co.uk] /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/base.rb:386:in 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 लोड '** [आउट :: abunchofletters .co.uk] /home/futureproof/.gems/bin/bundle:19 कमांड 13170ms *** में समाप्त हुआ [तैनाती: update_code] रोलिंग वापस * निष्पादित "आरएम-आरएफ /home/futureproof/abunchofletters.co .uk/विज्ञप्ति/20111118003703; सच " सर्वर: [" abunchofletters.co.uk "] [abunchofletters.co.uk] निष्पादन कमांड आदेश 563ms में समाप्त हुआ विफल:" sh -c 'cd /home/futureproof/abunchofletters.co.uk/releases/ 20111118003703 & & बंडल /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/bundle --deployment --quiet --without विकास परीक्षण --gemfile स्थापित ' "abunchofletters.co.uk पर
+0

किसी को भी किसी भी विचार है? – Rich

उत्तर

33

libv8 एक ओएस लाइब्रेरी है; आपको सही लिनक्स सिस्टम लाइब्रेरी स्थापित करने की आवश्यकता होगी। आप उबंटू चला रहे हैं, यह

sudo apt-get install libv8-dev 

वैकल्पिक रूप से है, तो आप node.js जो विभिन्न distros, उदा के लिए एक Debian/Ubuntu के पैकेज के रूप में उपलब्ध है स्थापित कर सकते हैंhttp://ppa.launchpad.net/chris-lea/node.js/ubuntu

आप हेरोोकू पर तैनाती करके खुद को बहुत परेशानी बचा सकते हैं, जहां आपको ओएस या रत्नों के लिए घटक प्रबंधित करने की आवश्यकता नहीं है।

+1

मेरे पास किसी साझा सर्वर पर सुडो अनुमति नहीं है लेकिन मैं node.js को हल करने में कामयाब रहा जिसने इसे हल किया। मैं हेरोोकू को उचित रूप से जाने का विचार कर रहा हूं, हालांकि संपत्तियों पाइपलाइन के साथ काम कर रहे रेल 3 साइट प्राप्त करने में कभी भी समस्याएं समाप्त नहीं होती हैं। – Rich

+1

@Rich, Heroku निश्चित रूप से सबसे अच्छा विकल्प है। डेवलपर के रूप में मुझे लगता है कि मैं सर्वर को बनाए रखने, सुरक्षित, पैच स्थापित, बैक अप इत्यादि रखने के लिए जो कुछ भी लेता हूं, उससे निपटना नहीं चाहता हूं। यह सबसे खराब समय पर सबसे अच्छा, अत्यधिक भंगुर समय लेने वाला है। विशेषज्ञों को ऐसा करने दें जो इसे अच्छी तरह से करते हैं। –

1

मैं सिर्फ एक देखा इस पर एक प्रस्तुति।

+०१२३५१६४१०६

मैंने अब तक रूबीथेरेसर का उपयोग किया है। जाहिर है यह इतना अच्छा नहीं है। और यह बहुत बड़ा है।

लेकिन आप किसी भी जावास्क्रिप्ट रनटाइम का उपयोग कर सकते हैं।

अन्य दो अनुशंसित हैं execjs और node.js (जो अभी बहुत गर्म है)।

अपने ऐप के लिए gem install चयनित मणि और फिर bundle install या bundle update सुनिश्चित करें।

एक अन्य नोट यह है कि आपको 1.9.2 पर भी स्विच करना चाहिए।
RVM इंस्टॉल करें (बैश < < (कर्ल -0 https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)) और आपके पास 1.8.7 और 1.9.2 दोनों तरफ हो सकते हैं।

11

मैं इस जवाहरात Dreamhost ऑन रेल्स 3.1 के साथ precompiler के रूप में एसेट पाइपलाइन

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 के लिए जॉनसन का उपयोग करें और क्रम के रूप में।

यह मेरे लिए 2 रेल 3.1 3.1 ड्रीमहोस्ट द्वारा होस्ट किए गए ऐप्स में काम करता है।

+0

टिप्पणी के लिए धन्यवाद। क्या आप साझा ड्रीमहोस्ट सर्वर या वीपीएस पर हैं? रूबी का क्या संस्करण आप चल रहे हैं? – Rich

122

आप Ubuntu पर कर रहे हैं, स्थापित

sudo apt-get install nodejs 
+3

उबंटू नैटी धन्यवाद पर काम करता है :) –

+1

धन्यवाद, यह समाधान काम करता है। – BlueDolphin

+0

thaks, कोलंबिया से बधाई – chenio

0
NodeJS

मैं NodeJS स्थापित करने का सुझाव देते हैं। यह मेरे लिए काम किया।

बस अपने टर्मिनल पर जाएँ और टाइप करें:

उपयुक्त sudo- मिल स्थापित Node.js

अपना पासवर्ड दर्ज करें ... और प्रेस 'Y' जब भी यह एक पुष्टिकरण के लिए पूछता है। आशा है कि ये आपकी मदद करेगा !!!

+1

जैसा कि मैंने वोल्फ्राम के उत्तर पर कहा था, मेरे पास मेरे साझा सर्वर पर सुडो अनुमति नहीं है लेकिन यह उन लोगों के लिए अच्छा काम कर सकता है जो ऐसा करते हैं। – Rich

5

मैं dreamhost साझा सर्वर में हूं।

मैंने रूट/सूडो का उपयोग किए बिना नोडज स्थापित किए। सर्वर पर:

#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, 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" 

आप

+0

मेरे मामले में, deploy.rb में जोड़ने के लिए PATH बस था: 'default_environment [" PATH "] =" $ HOME/स्थानीय/bin: $ PATH "' – Sunny

+0

मैं आपका समाधान आजमा रहा हूं लेकिन मुझे नहीं मिल रहा है deploy.rb फ़ाइल। मुझे ये कैसे मिल सकता है? क्या मुझे इसे कहीं बनाना चाहिए? –

1

किया जाता है मैंने अभी अपनी Win7 dev मशीन पर एक ही समस्या को मारा है। ऐसा लगता है कि https://github.com/hiranpeiris/therubyracer_for_windows इंस्टॉल करना और gem 'therubyracer'Gemfile चीजों को टाइप करना है।

से पहले:

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

यह मूलतः इसका मतलब है कि रेल की जरूरत rubyracer और libv8

के बाद:

Gemfile में
$ 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] 
(...) 
0

जोड़ें निम्नलिखित मणि और स्थापित

मणि "therubyracer" बंडल के साथ प्रयास करें, "~> 0.10.2"