TopClone
@TopClone
Новичек

Как исправить ошибки, выдаваемые при запуске сервера проекта?

Всем доброго времени суток!
Только что перешел на ubuntu и сразу сталкиваюсь с проблемами при запуске сервера проетка Blog на Ruby on Rails.

anton@Anton:~/Blog$ rails server
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:89:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/home/anton/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
/home/anton/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `'
/home/anton/.rvm/gems/ruby-2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `'
/home/anton/.rvm/gems/ruby-2.3.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `require'
/home/anton/.rvm/gems/ruby-2.3.0/gems/uglifier-3.0.0/lib/uglifier.rb:5:in `'
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
/home/anton/Blog/config/application.rb:7:in `'
/home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:78:in `require'
/home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:78:in `block in server'
/home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:75:in `tap'
/home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:75:in `server'
/home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands.rb:17:in `'
/home/anton/Blog/bin/rails:9:in `require'
/home/anton/Blog/bin/rails:9:in `'
/home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
/home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
/home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
/home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
/home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/bin/spring:49:in `'
/home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
/home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `'
/home/anton/Blog/bin/spring:13:in `require'
/home/anton/Blog/bin/spring:13:in `'
bin/rails:3:in `load'
bin/rails:3:in `'
Bundler Error Backtrace:
from /home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:85:in `block (2 levels) in require'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from /home/anton/Blog/config/application.rb:7:in `'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7/lib/rails/commands.rb:17:in `'
from /home/anton/Blog/bin/rails:9:in `require'
from /home/anton/Blog/bin/rails:9:in `'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/bin/spring:49:in `'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
from /home/anton/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `'
from /home/anton/Blog/bin/spring:13:in `require'
from /home/anton/Blog/bin/spring:13:in `'
from bin/rails:3:in `load'
from bin/rails:3:in `'


anton@Anton:~/Blog$ bundle check
The Gemfile's dependencies are satisfied


А после bundle у меня установились какие-то gem'ы, но это не помогло.
anton@Anton:~/Blog$ bundle
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using debug_inspector 0.0.2
Using byebug 9.0.5
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using bundler 1.12.5
Using sass 3.4.22
Using tilt 2.0.5
Using spring 1.7.2
Using sqlite3 1.3.11
Using turbolinks-source 5.0.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using mime-types 3.1
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using uglifier 3.0.0
Using sprockets 3.7.0
Using turbolinks 5.0.0
Using sdoc 0.4.1
Using activesupport 4.2.7
Using loofah 2.0.3
Using mail 2.6.4
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.7
Using jbuilder 2.6.0
Using rails-html-sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using activejob 4.2.7
Using activerecord 4.2.7
Using actionview 4.2.7
Using actionpack 4.2.7
Using actionmailer 4.2.7
Using railties 4.2.7
Using sprockets-rails 3.1.1
Using coffee-rails 4.1.1
Using jquery-rails 4.1.1
Using rails 4.2.7
Using sass-rails 5.0.6
Using web-console 2.3.0
Bundle complete! 12 Gemfile dependencies, 57 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.


Подскажите пожалуйста в чем проблема и какими путями её можно решить.
  • Вопрос задан
  • 1082 просмотра
Решения вопроса 2
Dem1
@Dem1 Куратор тега Ruby on Rails
Ruby on Rails developer
Установи nodejs
И научитесь читать ошибки
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Ответ написан
vladchernik
@vladchernik
system analyst | developer
Вам ведь сервер по-человечески пишет в чём проблема:
/home/anton/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:89:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.


Выполните в консоли:
sudo apt-get install nodejs
Потом ещё раз запустите bundle
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы