[英]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.