码迷,mamicode.com
首页 > 其他好文 > 详细

RHEL安装rails后启动报错

时间:2017-09-17 15:21:07      阅读:666      评论:0      收藏:0      [点我收藏+]

标签:backtrac   rail   backtrace   oca   tps   size   run   list   conf   

[root@redhat7 demo]# rails server
/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:86: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/rvm/gems/ruby-2.4.1/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect‘
/usr/local/rvm/gems/ruby-2.4.1/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>‘
/usr/local/rvm/gems/ruby-2.4.1/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>‘
/usr/local/rvm/gems/ruby-2.4.1/gems/uglifier-3.2.0/lib/uglifier.rb:5:in `require‘
/usr/local/rvm/gems/ruby-2.4.1/gems/uglifier-3.2.0/lib/uglifier.rb:5:in `<top (required)>‘
/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in `require‘
/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in `block (2 levels) in require‘
/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in `each‘
/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in `block in require‘
/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in `each‘
/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in `require‘
/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler.rb:114:in `require‘
/usr/local/jianbo/demo/config/application.rb:7:in `<top (required)>‘
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in `require‘
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in `block in perform‘
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `tap‘
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `perform‘
/usr/local/rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/command.rb:27:in `run‘
/usr/local/rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command‘
/usr/local/rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch‘
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform‘
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke‘
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>‘
/usr/local/jianbo/demo/bin/rails:9:in `require‘
/usr/local/jianbo/demo/bin/rails:9:in `<top (required)>‘
/usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load‘
/usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call‘
/usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call‘
/usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client.rb:30:in `run‘
/usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/bin/spring:49:in `<top (required)>‘
/usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load‘
/usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>‘
/usr/local/jianbo/demo/bin/spring:15:in `require‘
/usr/local/jianbo/demo/bin/spring:15:in `<top (required)>‘
bin/rails:3:in `load‘
bin/rails:3:in `<main>‘
Bundler Error Backtrace:
from /usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:82:in `block (2 levels) in require‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in `each‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in `block in require‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in `each‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in `require‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.0.pre.2/lib/bundler.rb:114:in `require‘
from /usr/local/jianbo/demo/config/application.rb:7:in `<top (required)>‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in `require‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in `block in perform‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `tap‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `perform‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/command.rb:27:in `run‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>‘
from /usr/local/jianbo/demo/bin/rails:9:in `require‘
from /usr/local/jianbo/demo/bin/rails:9:in `<top (required)>‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client.rb:30:in `run‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/bin/spring:49:in `<top (required)>‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load‘
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>‘
from /usr/local/jianbo/demo/bin/spring:15:in `require‘
from /usr/local/jianbo/demo/bin/spring:15:in `<top (required)>‘
from bin/rails:3:in `load‘
from bin/rails:3:in `<main>‘

解决办法

1.安装execjs、therubyracer

gem install execjs

gem  install therubyracer

2.安装nodejs

由于RHEL中没有这个包,其他安装方式太麻烦,找了半天决定使用

EPEL(什么是EPEL,参考我另一篇http://www.cnblogs.com/jasonboboblog/p/7535223.html)

首先要安装epel,直接用yum install epel

安装完后再用 yum install nodejs 就完成了,之后再用rails server

技术分享

 

 大功造成

 

RHEL安装rails后启动报错

标签:backtrac   rail   backtrace   oca   tps   size   run   list   conf   

原文地址:http://www.cnblogs.com/jasonboboblog/p/7535236.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!