Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

CSS file not being generated #414

Closed
dpmccabe opened this Issue · 28 comments
@dpmccabe

I'm using the most recent version of active_admin (master branch) and when I run the generator, it's making all of the assets, including JS, but not the CSS file.

Here's the output in a gist: https://gist.github.com/1172111

@gregbell
Owner

Hi Devin,

Running the active_admin:assets generator will not generate the CSS file. It is actually generated at runtime using SASS.

When you run the app, are the styles generated?

@dpmccabe

I'm able to access /stylesheets/active_admin.css, which contains imports for /stylesheets/active_admin/mixins.css and /stylesheets/active_admin/base.css. It's those two CSS files which give me 404s.

@paulogeyer

I'm having the same issue here, active admin is not generating mixins.css and base.css.

I've installed active admin on other project last month, everything is working fine, but on this new application I've got this problem

@paulogeyer

fixed by specifying activeadmin gem 0.2.2, looks like 0.3.0 have a problem with css generation

@dpmccabe

Any update on this? The gem isn't usable without the CSS.

@justinbburris

I'm running into an error which is similar to this. When I run rails g active_admin:install it creates everything but the css.

This is using rails 3.0.4

Previous versions haven't had this issue.

Thanks.

@paulyoder

I'm experiencing the same issue

@maikelcoke

same problem with activeadmin (0.3.2)

@giedriusr

doesn't work either.

@matchu

Just throwing my +1 in here for Rails 3.0.4. I have my own SASS running. Could there be a conflict?

@jfedick

I am experiencing the same problem too.

@joemsak

+1, and I probably posted a dupe issue #898

@joemsak

But when I visit http://localhost:3000/stylesheets/active_admin.css

I get

No route matches "/stylesheets/active_admin.css"

This project's Gemfile has "gem 'sass'" in it... might be a problem?

@behrangsa

+1. Those two css files are not being generated for me in a Rails 3.0.5 app.

@alanq

+1. The active_admin/mixins.css and base.css files are not created in a Rails 3.0.3 app.
I tried activeadmin gem 0.2.2 but errors with Formtastic gem 2.0.2

@joemsak

I removed sass from my Gemfile and still no luck

@joemsak

K, it works from a fresh rails 3.0.11 install ... investigating

Also confirmed: github edge works with a fresh install

@joemsak

K, got it!

If you're already using sass and you configured your compiled files to be generated in a folder besides public/stylesheets, then that's why it won't be found.

I changed the setting in my config/environment.rb and it's working.

Other than that, I don't know if you can override the active admin layout file to point in your sass dir, or if you can configure active admin to use a different directory, but that was it for me.

@pcreux pcreux closed this
@joseh-henrique

joemsak, i'm sorry, what you put into application, would put here as you did? I'm having the same problem does not work in production.

@bwx
bwx commented

I'm having the same problem does not work in any env, active_admin.css and js got 404 error, is there any solution ? AA 0.6.0, rr 3.2.11 ?

@seanlinsley
Owner

@bwx what problem exactly are you running into? Do these two files exist?

app/assets/javascript/active_admin.js
app/assets/stylesheets/active_admin.css.scss

I'm not familiar with this Issue, but a lot of people have been reporting 404 errors for URLs like this:

[site]/stylesheets/active_admin.css

But when Rails compiles your JS and CSS, they're made available under assets collectively. As in:

[site]/assets/active_admin.css
[site]/assets/active_admin.js
@mrjlynch

I'm still experiencing this issue and i'm not exactly sure how to solve it? @joemsak What do i need to put in my environment.rb file?

-- solution --

run:

rails generate active_admin:assets
@sebastialonso

The solution of @mrjlynch worked for me! Rails 4.0.2

@seanlinsley
Owner

A user in IRC seems to be running into this issue with Rails 4

@seanlinsley
Owner

It turns out that @Marthyn's application called include ActionView::Helpers::AssetTagHelper from an initializer for the merit gem, which was causing the problem by including those helper methods into the global namespace.

@mauriciopasquier

I'm not familiar with this Issue, but a lot of people have been reporting 404 errors for URLs like this:
[site]/stylesheets/active_admin.css

Sorry if it's not the right issue, but I had those URLs generated and after a lot of searching I ended up here without a solution. Luckily it hit me: you have to treat:

app/assets/javascript/active_admin.js.coffee
app/assets/stylesheets/active_admin.css.scss

like a manifest file and require the relevant assets there (I was using config/initializers/active_admin.rb and config.register_{stylesheet,javascript}, wich was what caused those 404ish URLs up there. Maybe is lack of documentation or maybe I missed it somewhere.

@andela-bbello

rails generate active_admin:assets
The above command works for me. I was able to get the styling back on rails 4 and active admin. After which I get this error below
WARNING: The box-sizing mixin is deprecated and will be removed in the next major version release. This property can now be used un-prefixed.

@timoschilling

@andela-bbello that's fixed in the newer versions of ActiveAdmin, see #3832 for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.