Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

rails_admin js/css no longer precompile in 0.0.4 #1192

Closed
rystraum opened this issue Jun 6, 2012 · 17 comments
Closed

rails_admin js/css no longer precompile in 0.0.4 #1192

rystraum opened this issue Jun 6, 2012 · 17 comments

Comments

@rystraum
Copy link

rystraum commented Jun 6, 2012

Just started a new rails project with 0.0.4 and production fails because it can't find pre-compiled rails_admin.js/css.
I downgraded my rails_admin to 0.0.3 and ran

rake assets:clean && RAILS_ENV=production rake assets:precompile 

and it precompiled rails_admin js/css.
Images are found and are precompiled in both cases, so it's just the CSS and JS that aren't precompiled.

@hugomaiavieira
Copy link
Contributor

Same issue here

@bbenezech
Copy link
Collaborator

Maybe related to 152dc34

@benbruscella
Copy link

Same here with 0.0.4

ActionView::Template::Error (rails_admin/rails_admin.css isn't precompiled):
    4:     %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
    5:     %meta{:content => "NONE,NOARCHIVE", :name => "robots"}
    6:     = csrf_meta_tag
    7:     = stylesheet_link_tag "rails_admin/rails_admin.css", :media => :all
    8:     = javascript_include_tag "rails_admin/rails_admin.js"

@qqshfox
Copy link
Contributor

qqshfox commented Jun 7, 2012

#1046 This works for me.

@bbenezech
Copy link
Collaborator

What exactly worked for you, @qqshfox ?

@qqshfox
Copy link
Contributor

qqshfox commented Jun 8, 2012

#1046 (comment), @bbenezech

@parkr
Copy link

parkr commented Jun 15, 2012

I get Undefined variable: "$red". in rails_admin/base/theming.css.scss:19 when I run rake assets:precompile

Here's my rake stack trace and application.rb file.

@galtenberg
Copy link

@qqshfox 's solution worked great. Thanks!

@rystraum
Copy link
Author

Edited the documentation for troubleshooting: https://github.com/sferik/rails_admin/wiki/Troubleshoot/_compare/4628de8a65028be16d2e6d9834ec28a55eca4e0c...863f5656f25ebac5652f903f18240f251d0b6fff

Although, if this problem is universal (that is everyone would absolutely, without a doubt, run into this problem), I think having it buried in the Troubleshoot wiki page is not the best way to go about this.

Probably having it up as a note when people run

rails generate rails_admin:install

instead, much like how Devise does their own post-install notes?
If people think the troubleshooting documentation is enough, I will close this issue.

@parkr
Copy link

parkr commented Jun 18, 2012

Added that, @rystraum, but didn't help:

/usr/local/Cellar/ruby/1.9.3-p194/bin/ruby /usr/local/bin/rake assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets
rake aborted!
Undefined variable: "$red".
  (in /usr/local/lib/ruby/gems/1.9.1/gems/rails_admin-0.0.4/app/assets/stylesheets/rails_admin/base/theming.css.scss)

Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/usr/local/Cellar/ruby/1.9.3-p194/bin/ruby...]

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

mshibuya added a commit that referenced this issue Jun 18, 2012
…h initialize_on_precompile = true and false. Refs #1192
@mshibuya
Copy link
Member

I've made slight modification to changes made by #1135.
I think this should fix the issue both on config.assets.initialize_on_precompile = false and true environment, but I've tested only locally.
Is there anyone who can see if it works on production envs(especially on Heroku) as expected?

@parkr
Yours is not related to this issue.
You'd better check discussions in #682 and #988.

@chewi
Copy link

chewi commented Jun 21, 2012

What I don't understand is whether this change was intentional. Are we supposed to add these to config.assets.precompile now? That doesn't seem right to me.

@rystraum
Copy link
Author

@chewi: That's why I suggested having it up as a note when you first run rails g rails_admin:install, if it was indeed intentional. In general, I don't mind, as long as it's documented anywhere.

@mshibuya
Copy link
Member

@chewi @rystraum
This is a regression, not an intentional issue.
And should be resolved by my recent commit, so can you guys see if the latest master precompiles RailsAdmin assets without adding config.assets.precompile += ... configuration?

@morgoth
Copy link
Contributor

morgoth commented Jul 4, 2012

@mshibuya it's working. This issue can be closed

@ktaragorn
Copy link

I am using 0.1.x version and I still need to follow those steps of remove the catch all, and add the +=

@heaven
Copy link

heaven commented Nov 15, 2014

I was using:

Rails.application.config.assets.precompile << /(^[^_\/]|\/[^_])[^\/]*$/

How should I handle this now? Do I need to specify all files manually? that doesn't seem right to me.

UPD. Fixed this way:

Rails.application.config.assets.precompile << /(?:^(?!rails_admin)(?:[^_\/]|\/[^_])+)[^\/]*$/
Rails.application.config.assets.precompile += %w[rails_admin/rails_admin.css rails_admin/rails_admin.js]

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests