首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于“uglifier”,rails web应用程序无法启动。

由于“uglifier”,rails web应用程序无法启动。
EN

Stack Overflow用户
提问于 2017-01-02 11:39:21
回答 2查看 407关注 0票数 1

试图加载创业板“丑器”时出错。

代码语言:javascript
复制
Gem Load Error is: wrong argument type Class (expected Module)
Backtrace for gem load error is:

/usr/local/lib/ruby/gems/2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:23:in `include'
/usr/local/lib/ruby/gems/2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:23:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:22:in `class_eval'
/usr/local/lib/ruby/gems/2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:22:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:21:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:21:in `<top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/therubyracer-0.12.2/lib/v8.rb:22:in `require'
/usr/local/lib/ruby/gems/2.4.0/gems/therubyracer-0.12.2/lib/v8.rb:22:in `<top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:108:in `require'
/usr/local/lib/ruby/gems/2.4.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:108:in `available?'
/usr/local/lib/ruby/gems/2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in `find'
/usr/local/lib/ruby/gems/2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in `best_available'
/usr/local/lib/ruby/gems/2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:57:in `autodetect'
/usr/local/lib/ruby/gems/2.4.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/usr/local/lib/ruby/gems/2.4.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/uglifier-3.0.4/lib/uglifier.rb:5:in `require'
/usr/local/lib/ruby/gems/2.4.0/gems/uglifier-3.0.4/lib/uglifier.rb:5:in `<top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `require'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in require'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require'
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require'
/var/www/geia.junyuzhu.com/public_html/testapp/config/application.rb:7:in `<top (required)>'
/var/www/geia.junyuzhu.com/public_html/testapp/config/environment.rb:2:in `require_relative'
/var/www/geia.junyuzhu.com/public_html/testapp/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require_relative'
config.ru:3:in `block in <main>'
/usr/local/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
Bundler Error Backtrace:
 (Bundler::GemRequireError)
  /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require'
  /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
  /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each'
  /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in require'
  /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each'
  /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require'
  /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require'
  /var/www/geia.junyuzhu.com/public_html/testapp/config/application.rb:7:in `<top (required)>'
  /var/www/geia.junyuzhu.com/public_html/testapp/config/environment.rb:2:in `require_relative'
  /var/www/geia.junyuzhu.com/public_html/testapp/config/environment.rb:2:in `<top (required)>'
  config.ru:3:in `require_relative'
  config.ru:3:in `block in <main>'
  /usr/local/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
  /usr/local/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `eval'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

我试图安装nodejs并重新启动apache服务器。这对这个问题没有帮助。

bundle show uglifier给出

代码语言:javascript
复制
/usr/local/lib/ruby/gems/2.4.0/gems/uglifier-3.0.4

我想我安装得很好。

另外,gem 'therubyracer', platforms: :ruby在Gemfile中没有注释。

请帮帮忙,我不知道如何解决这个问题。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-01-02 12:02:05

这是带有therubyracer和Ruby2.4的一个已知的问题。Ruby2.4的兼容性还存在一些额外的问题,这些问题在https://github.com/cowboyd/therubyracer/issues/430的问题跟踪器中被跟踪。

您应该使用Ruby的早期版本,例如2.3.3,直到新版本发布为止。

顺便说一句:有几个宝石与Ruby2.4还不兼容。为了避免在新版本发布后遇到大量兼容性问题,最好不要在发布的第一天进行升级。

票数 3
EN

Stack Overflow用户

发布于 2017-01-02 11:57:34

在默认的rails Gemfile中,gem therubyracer的行被注释掉。如果你取消评论,你会得到宝石,它应该能工作。(帮我解决了这个问题)

运行跟随推荐

代码语言:javascript
复制
sudo apt-get install nodejs

Uglifier是一个JS包装器,它需要运行JS运行时或JS解释器。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41426138

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档