我试图运行rails服务器,并尝试查看活动管理员是否正常,但我收到此错误: Admin :: Dashboard #index中的ExecJS :: RuntimeError SyntaxError:无效字符
和 每当我尝试访问localhost:3000 / admin
时,在我的命令提示符中出现此错误
ActionView::Template::Error (SyntaxError: Invalid character):
1: insert_tag active_admin_application.view_factory["page"]
execjs (2.7.0) lib/execjs/external_runtime.rb:39:in `exec'
execjs (2.7.0) lib/execjs/external_runtime.rb:14:in `initialize'
execjs (2.7.0) lib/execjs/runtime.rb:57:in `new'
execjs (2.7.0) lib/execjs/runtime.rb:57:in `compile'
execjs (2.7.0) lib/execjs/module.rb:27:in `compile'
babel-transpiler (0.7.0) lib/babel/transpiler.rb:24:in `context'
babel-transpiler (0.7.0) lib/babel/transpiler.rb:28:in `transform'
sprockets-es6 (0.9.2) lib/sprockets/es6.rb:70:in `transform'
sprockets-es6 (0.9.2) lib/sprockets/es6.rb:64:in `block in call'
sprockets (3.7.1) lib/sprockets/cache.rb:85:in `fetch'
sprockets-es6 (0.9.2) lib/sprockets/es6.rb:63:in `call'
sprockets-es6 (0.9.2) lib/sprockets/es6.rb:34:in `call'
sprockets (3.7.1) lib/sprockets/processor_utils.rb:75:in `call_proce
sprockets (3.7.1) lib/sprockets/processor_utils.rb:57:in `block in c
rs'
sprockets (3.7.1) lib/sprockets/processor_utils.rb:56:in `reverse_ea
sprockets (3.7.1) lib/sprockets/processor_utils.rb:56:in `call_proce
sprockets (3.7.1) lib/sprockets/processor_utils.rb:75:in `call_proce
sprockets (3.7.1) lib/sprockets/processor_utils.rb:57:in `block in c
rs'
sprockets (3.7.1) lib/sprockets/processor_utils.rb:56:in `reverse_ea
sprockets (3.7.1) lib/sprockets/processor_utils.rb:56:in `call_proce
sprockets (3.7.1) lib/sprockets/loader.rb:134:in `load_from_unloaded
sprockets (3.7.1) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.1) lib/sprockets/loader.rb:317:in `fetch_asset_from_d
che'
sprockets (3.7.1) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.1) lib/sprockets/cached_environment.rb:20:in `block i
'
sprockets (3.7.1) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.1) lib/sprockets/bundle.rb:23:in `block in call'
sprockets (3.7.1) lib/sprockets/utils.rb:200:in `dfs'
sprockets (3.7.1) lib/sprockets/bundle.rb:24:in `call'
sprockets (3.7.1) lib/sprockets/processor_utils.rb:75:in `call_proce
sprockets (3.7.1) lib/sprockets/processor_utils.rb:57:in `block in c
rs'
sprockets (3.7.1) lib/sprockets/processor_utils.rb:56:in `reverse_ea
sprockets (3.7.1) lib/sprockets/processor_utils.rb:56:in `call_proce
sprockets (3.7.1) lib/sprockets/loader.rb:134:in `load_from_unloaded
sprockets (3.7.1) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.1) lib/sprockets/loader.rb:317:in `fetch_asset_from_d
che'
sprockets (3.7.1) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.1) lib/sprockets/cached_environment.rb:20:in `block i
'
sprockets (3.7.1) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.1) lib/sprockets/base.rb:66:in `find_asset'
sprockets (3.7.1) lib/sprockets/base.rb:73:in `find_all_linked_asset
sprockets (3.7.1) lib/sprockets/manifest.rb:134:in `block in find'
sprockets (3.7.1) lib/sprockets/manifest.rb:133:in `each'
sprockets (3.7.1) lib/sprockets/manifest.rb:133:in `find'
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:50:in `each'
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:50:in `map'
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:50:in `precompiled_
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:35:in `asset_precom
sprockets-rails (3.2.1) lib/sprockets/railtie.rb:251:in `block (3 le
ass:Railtie>'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:359:in `precom
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:363:in `raise_
mpiled_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:348:in `find_d
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:229:in `block
bug_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:242:in `block
sset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `each'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `detect
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `resolv
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:228:in `lookup
'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:170:in `block
t_link_tag'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:169:in `map'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:169:in `styles
g'
arbre (1.1.1) lib/arbre/element.rb:180:in `method_missing'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/bundler/gems/activea
d307a/lib/active_admin/views/pages/base.rb:29:in `block in build_act
ad'
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element
arbre (1.1.1) lib/arbre/element/builder_methods.rb:49:in `with_curre
ment'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/bundler/gems/activea
d307a/lib/active_admin/views/pages/base.rb:26:in `build_active_admin
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/bundler/gems/activea
d307a/lib/active_admin/views/pages/base.rb:9:in `build'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:30:in `block in b
arbre (1.1.1) lib/arbre/context.rb:92:in `with_current_arbre_element
arbre (1.1.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.1.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/bundler/gems/activea
d307a/app/views/active_admin/page/index.html.arb:2:in `block in ____
er__uby______lib_ruby_gems_______bundler_gems_activeadmin___b____d__
_active_admin_page_index_html_arb___133872153_81819624'
arbre (1.1.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.1.1) lib/arbre/context.rb:45:in `initialize'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/bundler/gems/activea
d307a/app/views/active_admin/page/index.html.arb:1:in `new'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/bundler/gems/activea
d307a/app/views/active_admin/page/index.html.arb:1:in `_____ails_nst
____lib_ruby_gems_______bundler_gems_activeadmin___b____d___a_app_vi
dmin_page_index_html_arb___133872153_81819624'
actionview (5.1.4) lib/action_view/template.rb:157:in `block in rend
activesupport (5.1.4) lib/active_support/notifications.rb:168:in `in
actionview (5.1.4) lib/action_view/template.rb:352:in `instrument_re
e'
actionview (5.1.4) lib/action_view/template.rb:155:in `render'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:52:
levels) in render_template'
actionview (5.1.4) lib/action_view/renderer/abstract_renderer.rb:42:
instrument'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `bl
ument'
activesupport (5.1.4) lib/active_support/notifications/instrumenter.
strument'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `in
actionview (5.1.4) lib/action_view/renderer/abstract_renderer.rb:41:
nt'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:51:
render_template'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:59:
ith_layout'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:50:
emplate'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:14:
actionview (5.1.4) lib/action_view/renderer/renderer.rb:42:in `rende
actionview (5.1.4) lib/action_view/renderer/renderer.rb:23:in `rende
actionview (5.1.4) lib/action_view/rendering.rb:103:in `_render_temp
actionpack (5.1.4) lib/action_controller/metal/streaming.rb:217:in `
late'
actionview (5.1.4) lib/action_view/rendering.rb:83:in `render_to_bod
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:52:in `r
y'
actionpack (5.1.4) lib/action_controller/metal/renderers.rb:141:in `
dy'
actionpack (5.1.4) lib/abstract_controller/rendering.rb:24:in `rende
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:36:in `r
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:44
2 levels) in render'
activesupport (5.1.4) lib/active_support/core_ext/benchmark.rb:12:in
s'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/benchmark.rb:308:in `real
activesupport (5.1.4) lib/active_support/core_ext/benchmark.rb:12:in
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:44
n render'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:87
_view_runtime'
activerecord (5.1.4) lib/active_record/railties/controller_runtime.r
anup_view_runtime'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:43
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/bundler/gems/activea
d307a/lib/active_admin/page_controller.rb:14:in `index'
actionpack (5.1.4) lib/action_controller/metal/basic_implicit_render
nd_action'
actionpack (5.1.4) lib/abstract_controller/base.rb:186:in `process_a
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:30:in `p
n'
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:20:in `block
action'
activesupport (5.1.4) lib/active_support/callbacks.rb:131:in `run_ca
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:19:in `proce
actionpack (5.1.4) lib/action_controller/metal/rescue.rb:20:in `proc
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:32
n process_action'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `bl
ument'
activesupport (5.1.4) lib/active_support/notifications/instrumenter.
strument'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `in
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:30
_action'
actionpack (5.1.4) lib/action_controller/metal/params_wrapper.rb:252
_action'
activerecord (5.1.4) lib/active_record/railties/controller_runtime.r
cess_action'
actionpack (5.1.4) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.4) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.4) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.4) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:49:in `d
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:31:in `s
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:50:in `bloc
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `each
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `serv
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:834:in `
rack (2.0.3) lib/rack/etag.rb:25:in `call'
rack (2.0.3) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.3) lib/rack/head.rb:12:in `call'
rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/cookies.rb:613:in
activerecord (5.1.4) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:26:in
all'
activesupport (5.1.4) lib/active_support/callbacks.rb:97:in `run_cal
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:24:in
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in
actionpack (5.1.4) lib/action_dispatch/middleware/debug_exceptions.r
l'
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in ca
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/show_exceptions.rb
'
railties (5.1.4) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `bl
d'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:26:in `ta
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `ta
railties (5.1.4) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `c
actionpack (5.1.4) lib/action_dispatch/middleware/remote_ip.rb:79:in
actionpack (5.1.4) lib/action_dispatch/middleware/request_id.rb:25:i
rack (2.0.3) lib/rack/method_override.rb:22:in `call'
rack (2.0.3) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.4) lib/active_support/cache/strategy/local_cache_
b:27:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in
actionpack (5.1.4) lib/action_dispatch/middleware/static.rb:125:in `
rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
railties (5.1.4) lib/rails/engine.rb:522:in `call'
puma (3.10.0) lib/puma/configuration.rb:225:in `call'
puma (3.10.0) lib/puma/server.rb:605:in `handle_request'
puma (3.10.0) lib/puma/server.rb:437:in `process_client'
puma (3.10.0) lib/puma/server.rb:301:in `block in run'
puma (3.10.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread'

这是什么错误?有人可以帮忙吗?
答案 0 :(得分:0)
我认为这不是ActiveAdmin问题,而是与Windows上的ExecJS有关。我认为ExecJS::RuntimeError on Windows trying to follow rubytutorial可能就是你要找的东西。
答案 1 :(得分:0)
这不是ActiveAdmin问题,也许在您在app / assests / javascript .js或.coffee文件中编写时,还会编写一些不必要的代码,所以请检查一下
答案 2 :(得分:0)
从application.js中删除行// = require_tree,它消除了我的错误