Я сгенерировал страницу с помощью контроллера. Но когда я иду на localhost: 3000/pages/home. Я получил эту ошибку: ExecJS :: RuntimeError в Страницы # домаRuby on Rails ExecJS :: RuntimeError в Pages # home
@RyanBigg Хорошо вот полный код ошибки:
ExecJS::RuntimeError in Pages#home
Showing C:/Users/Anishka/Desktop/test/myfirstapp/app/views/layouts/application.html.erb where line #6 raised:
(in C:/Users/Anishka/Desktop/test/myfirstapp/app/assets/javascripts/pages.js.coffee)
Extracted source (around line #6):
3: <head>
4: <title>Myfirstapp</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
9: <body>
Rails.root: C:/Users/Anishka/Desktop/test/myfirstapp
Application Trace | Framework Trace | Full Trace
app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__601430158_32305500'
Request
Parameters:
None
Show session dump
Show env dump
Response
Headers:
None
Я нашел решение здесь ExecJS::RuntimeError on Windows trying to follow rubytutorial
который:
The Fix that worked for us: On the system having issues, find ExecJS's runtimes.rb file. It looks like this. Make a copy of the found file for backup. Open the original runtimes.rb for editing. Find the section that starts with the line JScript = ExternalRuntime.new(. In that section, on the line containing :command => "cscript //E:jscript //Nologo //U", - remove the //U only. Then on the line containing :encoding => 'UTF-16LE' # CScript with //U returns UTF-16LE - change UTF-16LE to UTF-8 . Save the changes to the file. This section of the file should now read:
JScript = ExternalRuntime.new( :name => "JScript", :command => "cscript //E:jscript //Nologo", :runner_path => ExecJS.root + "/support/jscript_runner.js", :encoding => 'UTF-8' # CScript with //U returns UTF-16LE) Next, stop then restart your Rails server and refresh the page in your browser that produced the original error. Hopefully the page loads without error now.
Но где файл runtimes.rb? Я не мог найти ничего подобного. Я начинаю рельсы, и ваша помощь будет оценена, спасибо.
ExecJS поддерживает эти среды выполнения: 'therubyracer - встроенный Google V8 ithin Рубин therubyrhino - Mozilla Rhino встроенный в JRuby Node.js Apple, JavaScriptCore - в комплекте с Mac OS X Microsoft Windows Script Host (JScript) ' –
вы установили' therubyracer' камень –
Пожалуйста, покажите нам полное сообщение об ошибке. Вам не хватает его части со своего поста. –