Lewis Frost
Lewis Frost

Reputation: 557

Get this error when installing ActiveAdmin in Ruby on Rails?

I am new to rails and I am trying to install activeadmin

I added gem 'activeadmin' to my gem file. I then run bundle update.

I then rails g active_admin:install, which worked

Next I migrated the database, which also worked

However when I go to localhost:3000/admin, i get this error:

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.

Any suggestions?

Upvotes: 0

Views: 1304

Answers (2)

Michael Gajda
Michael Gajda

Reputation: 105

Its a known bug that occured with an updated coffee script parser - in the github issues is a fixed branch referenced:

gem 'activeadmin', github: 'Daxter/active_admin', branch: 'bugfix/1773-execjs'

try this if you got any errors like this with active admin til they merge the fix in

Upvotes: 1

Lewis Frost
Lewis Frost

Reputation: 557

I removed

//=require active_admin/base 

from active_admin.js and it worked!

Hope this helps anyone that has the same problem

Upvotes: 2

Related Questions