简体   繁体   English

如何修复 Rails RuntimeError Current ExecJ 不支持 ES5?

[英]How do I fix Rails RuntimeError Current ExectJ doesn't support ES5?

When I go to update the page "localhost: 3000" at the end of the lesson I get what happens in the image I have attached.当我在课程结束时更新页面“localhost:3000”时,我会在我附加的图像中看到发生了什么。 While if I unload "node.js" the "localhost: 3000" does not work anymore, ie it gives me this error "We're sorry, but something went wrong.If you are the application owner check the logs for more information."虽然如果我卸载“node.js”,“localhost:3000”将不再工作,即它给我这个错误“我们很抱歉,但出了点问题。如果您是应用程序所有者,请检查日志以获取更多信息。 ” Why?为什么?

运行时错误图像

The main problem was in your Gemfile here主要问题出在您的 Gemfile 中

gem 'therubyracer', platforms: :ruby
gem 'mini_racer', platforms: :ruby

You had two racer type gems, you only need one.你有两颗赛车型宝石,你只需要一颗。

You should just use gem 'mini_racer' and get rid of therubyracer .您应该只使用gem 'mini_racer'并摆脱therubyracer Do that and run bundle install .这样做并运行bundle install You will also need to clean up merge conflict stuff left in your routes.rb file.您还需要清理routes.rb文件中留下的合并冲突内容。 Do that before bundle install and you should be good.bundle install之前执行此操作,您应该会很好。

You probably also don't need to lock your gem versions until you have a more developed and stable stack.在您拥有更发达和更稳定的堆栈之前,您可能也不需要锁定您的 gem 版本。 You might as well upgrade everything early on since some of the versions you have our out of date.您最好尽早升级所有内容,因为您的某些版本已经过时。 To upgrade your gems just remove all the version stuff after each gem line ie要升级您的 gems,只需在每个 gem 行之后删除所有版本的东西,即

gem 'coffee-rails', '~> 4.2' 

can just be可以只是

gem 'coffee-rails'

After removing them all, then run全部删除后,然后运行

bundle update

Here is a patchfile which will do these things in case you have a problem.这是一个补丁文件,它会在您遇到问题时执行这些操作。 You can save this locally and then just run git apply fix_gem_dependancies.patch if you like.您可以将其保存在本地,然后根据需要运行git apply fix_gem_dependancies.patch

UPDATE LAST ONE: This is the last thing I'm doing on this.更新最后一个:这是我在这方面做的最后一件事。 Get rid of gems you don't need, just use this Gemfile摆脱你不需要的宝石,只需使用这个 Gemfile

source 'https://rubygems.org'

gem 'rails', '~> 5.1.3'
gem 'sqlite3'
gem 'puma', '~> 3.7'
gem 'sass-rails'
gem 'uglifier'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'
gem 'sdoc'

gem 'autoprefixer-rails'

gem 'execjs'

gem 'materialize-sass'


group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end

group :development do
  gem 'web-console', '>= 3.3.0'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

The patch I sent you should have fixed the routes but you obviously don't know what you're doing with git.我发给你的补丁应该已经修复了路由,但你显然不知道你在用 git 做什么。 So here is your routes.rb file所以这是你的 routes.rb 文件

Rails.application.routes.draw do

  root 'pages#home'

  get 'about' => 'pages#about'

  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复移动菜单太长而无法滚动且不显示菜单上的所有项目 - How do I fix a mobile menu that is too long to scroll and doesn't show all the items on the menu 如何在编辑后修复导航栏,现在移动版本不起作用? - How do I fix the nav bar after edits and now mobile version doesn't work? 如何修复此 xml 和 xsl 代码,因为它不起作用 - How do I fix this xml and xsl code because it doesn't work 如何修复在 Edge 上运行良好但在 IE 上不起作用的 CSS - How do I fix my CSS which works fine on Edge but doesn't on IE 如何修复错误“预期的标签名称,得到”? 反而? (Html 不支持处理指令)”在 PHP 中。 (我正在使用 CodeTasty.com) - How can I fix the error “Expected tag name, got “?” instead! (Html doesn’t support processing instructions)” in PHP? (I'm using CodeTasty.com) h:panelgroup似乎继承了`dir`标记,但不支持它。 如何为每个panelGroup定义`dir`? - h:panelgroup seems to inherit the `dir` tag but doesn't support it. How Do I define `dir` per panelGroup? 如何对ES5中从服务器返回的图像实施延迟加载? - How to implement lazy load for images returned from a server in ES5? 如何确定运动的背景图像不会出现毛刺? - How can I fix that the moving background image doesn't glitch? 如果这些代码在一个页面上不起作用但在另一个页面上起作用,我如何修复某些特定属性上的外部 css 代码错误? - How do i fix external css code error on some specific attributes if those codes doesn't work on one page but work on another? Angular JS模板:-无法加载模板文件“ todo.tpl.html”吗? 我该如何解决? - Angular JS Templates:- the file 'todo.tpl.html' which is a template file doesn't load? How do I fix this?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM