• 0

أحصل على خطأ Could not find a JavaScript runtime عند تشغيل خادوم تطبيق ريلز، فما الحل؟

لقد قمت بإنشاء تطبيق Rails ولكنّني فوجئت بخطأ عند تشغيل Rails server ، فكيف يُمكنني أن أصلح هذا الخطأ؟

نصّ الخطأ:

/home/dyouri/.rvm/gems/ruby-2.2.1/gems/execjs-2.6.0/lib/execjs/runtimes.rb:48:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/execjs-2.6.0/lib/execjs.rb:5:in `<module:ExecJS>'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/execjs-2.6.0/lib/execjs.rb:4:in `<top (required)>'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `require'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `<top (required)>'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
	from /home/dyouri/rails/Project/config/application.rb:7:in `<top (required)>'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
	from /home/dyouri/rails/Project/bin/rails:8:in `require'
	from /home/dyouri/rails/Project/bin/rails:8:in `<top (required)>'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/spring-1.4.0/lib/spring/client/rails.rb:28:in `load'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/spring-1.4.0/lib/spring/client/rails.rb:28:in `call'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/spring-1.4.0/lib/spring/client/command.rb:7:in `call'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/spring-1.4.0/lib/spring/client.rb:28:in `run'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/spring-1.4.0/bin/spring:49:in `<top (required)>'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/spring-1.4.0/lib/spring/binstub.rb:11:in `load'
	from /home/dyouri/.rvm/gems/ruby-2.2.1/gems/spring-1.4.0/lib/spring/binstub.rb:11:in `<top (required)>'
	from /home/dyouri/rails/Project/bin/spring:13:in `require'
	from /home/dyouri/rails/Project/bin/spring:13:in `<top (required)>'
	from bin/rails:3:in `load'
	from bin/rails:3:in `<main>'


 

انشر على الشّبكات الاجتماعية


رابط هذه المساهمة
  • 0

هذا الخطأ شائع جدّا، ومن الطّبيعي أن يحدث إن كنت تستعمل أحد توزيعات لينكس، والحل أن تقوم بتنصيب أحد مكتبات Javascript runtime مثل Nodejs :

لتنصيب NodeJs على Ubuntu، طبّق الأمر التّالي في الطّرفيّة:

sudo apt-get install nodejs

إذا كُنت تستعمل أحد التّوزيعات التّي تعتمد على مدير الحزم yum فطبّق الأمر التّالي في الطّرفيّة:

yum -y install nodejs

انشر على الشّبكات الاجتماعية


رابط هذه المساهمة

يجب أن تكون عضوًا لدينا لتتمكّن من التعليق

انشاء حساب جديد

يستغرق التسجيل بضع ثوان فقط


سجّل حسابًا جديدًا

تسجيل الدخول

تملك حسابا مسجّلا بالفعل؟


سجّل دخولك الآن