Cannot install Active Admin for Ruby on Rails: "Asterisks :: FileNotFound ..."

I installed the new rails application locally and then added the active admin gem and ran rake db: migrate and then installed as instructed. I also use powder.

When I try to access the admin area in mysite.dev/admin, I get the following:

Asterisks :: FileNotFound in Active_admin / devise / sessions # new

could not find the file 'jquery-ui' (in / usr / local / rvm / gems / ruby-1.9.3-p392 / gems / activeadmin-0.6.0 / app / assets / javascripts / active_admin / base.js / 2)

What am I doing wrong?

+6
source share
3 answers

You must install gem: gem 'jquery-rails', "2.3.0" in your file to fix the gem version of jquery-rails to version 2.3.0. The latest update (3.0.0) removes the jquery-ui files and causes this problem:

couldn't find file 'jquery-ui' (in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activeadmin-0.6.0/app/assets/javascripts/active_admin/base.js:2) 

This should fix your problem for now. You can also get the latest Active Admin from github, which fixes your problem.

But I would advise changing

 gem jquery-rails 

in your gemfile:

 gem 'jquery-rails', "2.3.0" 

Hope this helps!

+18
source

I upgraded to the latest version (0.6.0) and I had the same problem.
Instead of lowering my jquery rails or setting the gem directly from github, I change //= require active_admin/base to my in active_admin.js for:

 //= require jquery //= require jquery_ujs //= require jquery.ui.core //= require jquery.ui.widget //= require jquery.ui.datepicker //= require active_admin/application 
+8
source

At startup:

 rails generate active_admin:assets 

it generates:

 /app/assets/javascripts/active_admin.js 

This file contains only one line, which should pull the base js file from the Gem:

 //= require active_admin/base 

active_admin / base (in Gem) - only 4 lines, one of which causes a problem:

 //= require jquery //= require jquery-ui //= require jquery_ujs //= require active_admin/application 

The workaround I chose is to change the contents of your project / app / assets / javascripts / active _admin.js:

 //= require jquery //= require jquery.ui.all //= require jquery_ujs //= require active_admin/application 
0
source

Source: https://habr.com/ru/post/946452/


All Articles