[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后启动报错的更多相关文章

  1. 安装mongodb后启动报错libstdc++

    安装mongo后启动报错如下图 显然说是libstdc++.so文件版本的问题,这种一般都是gcc版本太低了 接着查询gcc的版本    strings /usr/lib/libstdc++.so.6 ...

  2. linux安装tomcat后启动报错Cannot find ./catalina.sh的解决方法

    linux安装tomcat后启动报错: Cannot find ./catalina.shThe file is absent or does not have execute permissionT ...

  3. Docker安装完成后启动报错:Failed to start Docker Application Container Engine

    报错如下:显示没有启动 先关闭防火墙:防火墙关闭指令请看  <a href="Linux防火墙篇">https://www.cnblogs.com/szx666/p/1 ...

  4. centos7 安装docker后启动报错

    启动docker   $ sudo systemctl start docker 报错. 查看状态: $ systemctl status docker.service -l 加 -l 有的行信息很长 ...

  5. eclipse tomcat路径更改后启动报错

      eclipse tomcat路径更改后启动报错 CreateTime--2018年5月3日14:48:22 Author:Marydon 1.情景还原 2.原因 本地的tomcat路径修改后,ec ...

  6. dialogic d300语音卡驱动重装后启动报错问题解决方法

    dialogic d300 驱动重装后 dlstart  报错解决 问题描述:dlstart  后如下报错 [root@BJAPQ091 data]#dlstop Stopping Dialogic ...

  7. gitblit在windows10上的安装及服务启动报错处理

    折腾一下午算是装好了,心情不错决定分享一下.安装步骤大同小异网上都有,主要是Failed creating java 这个报错,百度出来的没有一个能给我解决的,摸索半天找出一个自己的方式.为报错而来的 ...

  8. docker安装后启动报错

    docker安装后启动不起来: 查看日志  /var/log/message    其中有一行为:  Your kernel does not support cgroup memory limit ...

  9. keepalived yum安装后启动报错解决

    [root@centos8 ~]yum install keepalived -y [root@centos8 ~]systemctl start keepalived.services [root@ ...

随机推荐

  1. 强制浏览器以IE8版本运行

    做为一个开发人员,经常被要求前端页面兼容ie8及以上,所以有时候我们希望ie默认以ie8的版本打开我们的页面. 1.“文档模式”: 在html页面中加入类似下面的代码: <meta http-e ...

  2. python课后练习当前目录下有一个文件名为score3.txt的文本文件, 存放着某班学生的学号和其两门专业课的成绩。

    题目: 当前目录下有一个文件名为score3.txt的文本文件, 存放着某班学生的学号和其两门专业课的成绩.分 别用函数实现以下功能: (1) 定义函数function1,计算每个学生的平均分(取 整 ...

  3. 干货 | 把Flutter扩展到微信小程序端的探索

    Google Flutter是一个非常优秀的跨端框架,不仅可以运行在Android. iOS平台,而且可以支持Web和桌面应用.在国内小程序是非常重要的技术平台,我们也一直思考能否把Flutter扩展 ...

  4. 干货 | 运维福音——Terraform自动化管理京东云

    干货 | 运维福音--Terraform自动化管理京东云 原创: 张宏伟 京东云开发者社区  昨天 Terraform是一个高度可扩展的IT基础架构自动化编排工具,主张基础设施即代码,可通过代码集中管 ...

  5. go语言使用

    设置 package control 在 Preferences->Package Setting->Package Control->Settings - User 中加入 cha ...

  6. 4)栈和队列-->受限线性表

    栈和队列叫  受限线性表  只不过他们插入和删除的位置  相对于之前的线性表有了限制   所以叫受限线性表 1)栈-->就是先进后出 2)队列-->先进先出 3)循环链表框图: 4)队列

  7. 01Java-方法

    一:动手动脑 1.编写一个方法,使用以上算法生成指定数目(比如1000个)的随机整数 package reserve; import java.util.Scanner; import java.ut ...

  8. 系统学习python第四天学习笔记

    1.解释 / 编译补充 编译型:代码写完后,编译器将其变成成另外一个文件,然后交给计算机执行. 解释型:写完代码交给解释器,解释器会从上到下一行行代码执行:边解释边执行. [实时翻译] 2.字符串功能 ...

  9. 拉格朗日乘子(Lagrange multify)和KKT条件

    拉格朗日乘子(Lagrange multify)和KKT条件 无约束问题 无约束问题定义如下: f(x)称为目标函数, 其中x是一个向量,它的维度是任意的. 通过求导, 令导数等于零即可: 如下图所示 ...

  10. vue中在时间输入框中默认显示时间

    <template> <card> <label>开始时间</label> <DatePicker v-model="startTime ...