@Intelide

Как запутить веб сервера ruby?

Здравствуйте, решил попробовать rubyonrails
делаю по этой rusrails.ru/getting-started-with-rails инструкции на centos 6
rails --version
Rails 5.0.0.1
ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

выполняю команду
bin/rails server
выходят следующие ошибки
bin/rails server
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:94: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:
/usr/local/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
/usr/local/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/usr/local/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/uglifier-3.0.2/lib/uglifier.rb:5:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/uglifier-3.0.2/lib/uglifier.rb:5:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:91:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:86:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:86:in `block in require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:75:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:75:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler.rb:106:in `require'
/home/vladimir/web/blog/config/application.rb:7:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
/home/vladimir/web/blog/bin/rails:9:in `require'
/home/vladimir/web/blog/bin/rails:9:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/bin/spring:49:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/vladimir/web/blog/bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Bundler Error Backtrace:
        from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
        from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:86:in `each'
        from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:86:in `block in require'
        from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:75:in `each'
        from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:75:in `require'
        from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.1/lib/bundler.rb:106:in `require'
        from /home/vladimir/web/blog/config/application.rb:7:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in `require'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
        from /home/vladimir/web/blog/bin/rails:9:in `require'
        from /home/vladimir/web/blog/bin/rails:9:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
        from /usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
        from /usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
        from /usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
        from /usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/bin/spring:49:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
        from /usr/local/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /home/vladimir/web/blog/bin/spring:13:in `<top (required)>'
        from bin/rails:3:in `load'
        from bin/rails:3:in `<main>'

gem install execjs уже устанавливал
Подскажите пожалуйста чего еще не хватает и как установить.
  • Вопрос задан
  • 413 просмотров
Решения вопроса 1
Нужно установить nodejs https://nodejs.org/en/download/package-manager/#en...
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
2ord
@2ord
Из rusrails.ru/getting-started-with-rails
Компилирование CoffeeScript и сжатие файлов JavaScript требует JavaScript runtime в вашей системе, и его отсутствие приведет к ошибке execjs во время компиляции. Обычно Mac OS X и Windows поставляются с установленным JavaScript runtime. Rails добавляет гем therubyracer в генерируемый Gemfile нового приложения в закомментированной строке, если нужно, можете ее раскомментировать. therubyrhino - рекомендованный runtime для пользователей JRuby, он добавляется в Gemfile, если приложение создаётся под JRuby. Можно узнать все о поддерживаемых runtime-ах в ExecJS

execjs - это лишь обёртка для внешних интерпретаторов JavaScript. Установи также пакет Node.js или библиотеку libv8 для дополнительного гема therubyracer.
Ответ написан
Комментировать
Ваш ответ на вопрос

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

Похожие вопросы