[英]Get this error when installing ActiveAdmin in Ruby on Rails?
I am new to rails and I am trying to install activeadmin 我是Rails的新手,我正在尝试安装activeadmin
I added gem 'activeadmin'
to my gem file. 我在gem文件中添加了
gem 'activeadmin'
。 I then run bundle update
. 然后,我运行
bundle update
。
I then rails g active_admin:install
, which worked 然后我用
rails g active_admin:install
起作用
Next I migrated the database, which also worked 接下来,我迁移了数据库,这也起作用
However when I go to localhost:3000/admin
, i get this error: 但是,当我转到
localhost:3000/admin
,出现此错误:
ExecJS::RuntimeError in Active_admin/devise/sessions#new
Showing /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activeadmin-0.5.1/app/views/layouts/active_admin_logged_out.html.erb where line #12 raised:
SyntaxError: cannot return a value from a constructor: "this" in class DropdownMenu
(in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activeadmin-0.5.1/app/assets/javascripts/active_admin/components/jquery.aa.dropdown-menu.js.coffee)
Extracted source (around line #12):
9: <%= stylesheet_link_tag style.path, style.options.dup %>
10: <% end %>
11: <% ActiveAdmin.application.javascripts.each do |path| %>
12: <%= javascript_include_tag path %>
13: <% end %>
14:
15: <%= csrf_meta_tag %>
At the moment I am not sure where: Active_admin/devise/sessions#new is. 目前,我不确定在哪里:Active_admin / devise / sessions#new在哪里。
Any suggestions? 有什么建议么?
I removed 我删除了
//=require active_admin/base
from active_admin.js and it worked! 从active_admin.js开始,就可以了!
Hope this helps anyone that has the same problem 希望这对遇到同样问题的人有所帮助
Its a known bug that occured with an updated coffee script parser - in the github issues is a fixed branch referenced: 它是在更新的coffee脚本解析器中发生的已知错误-在github问题中是引用的固定分支:
gem 'activeadmin', github: 'Daxter/active_admin', branch: 'bugfix/1773-execjs'
gem'activeadmin',github:'Daxter / active_admin',分支:'bugfix / 1773-execjs'
try this if you got any errors like this with active admin til they merge the fix in 如果您在使用活动管理员时遇到任何此类错误,请尝试此操作,直到它们合并了修复程序
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.