randym / activeadmin-axlsx

ActiveAdmin plugin using Axlsx for adding Excel (xlsx) download links for your resources
MIT License
82 stars 134 forks source link

axlsx and assets:precompile doesnt work ! #12

Closed ghost closed 11 years ago

ghost commented 11 years ago

I have issue to precompile assets with axlsx active admin gem, without having it in gem everything works fine

i do have meta_search and inherited_resources in gemfile

rake aborted!
uninitialized constant InheritedResources::Base
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activeadmin-0.6.0/lib/active_admin/base_controller/authorization.rb:21:in `<module:ActiveAdmin>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activeadmin-0.6.0/lib/active_admin/base_controller/authorization.rb:1:in `<top (required)>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activeadmin-0.6.0/lib/active_admin/base_controller.rb:3:in `<top (required)>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activeadmin-0.6.0/lib/active_admin/resource_controller/actions.rb:2:in `<module:ActiveAdmin>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activeadmin-0.6.0/lib/active_admin/resource_controller/actions.rb:1:in `<top (required)>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activeadmin-0.6.0/lib/active_admin/resource_controller.rb:2:in `<top (required)>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activeadmin-axlsx-2.1.2/lib/active_admin/axlsx.rb:21:in `block in <class:Railtie>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.5/lib/active_support/lazy_load_hooks.rb:34:in `call'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.5/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.5/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.5/lib/active_support/lazy_load_hooks.rb:42:in `each'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.5/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.5/lib/rails/application/bootstrap.rb:69:in `block in <module:Bootstrap>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.5/lib/rails/initializable.rb:30:in `instance_exec'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.5/lib/rails/initializable.rb:30:in `run'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.5/lib/rails/initializable.rb:54:in `each'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.5/lib/rails/initializable.rb:54:in `run_initializers'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.5/lib/rails/application.rb:136:in `initialize!'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.5/lib/sprockets/assets.rake:95:in `block (2 levels) in <top (required)>'
Tasks: TOP => assets:clean:all => assets:environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/martin/.rvm/rubies/ruby-1.9.3-p392/b...]
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.5/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.5/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/martin/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.5/lib/sprockets/assets.rake:80:in `block (2 levels) in <top (required)>'
/home/martin/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/home/martin/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:clean
(See full trace by running task with --trace)
rafaeliga commented 11 years ago

+1

FrostEnd commented 11 years ago

+1

esa-pia commented 11 years ago

+1

KrzysztofKowalski commented 11 years ago

+1 :((((((((

rapsad commented 11 years ago

+1

itismadhan commented 11 years ago

+1

antob commented 11 years ago

Not sure why yet, but one workaround is to not require the gem in the Gemfile, e.g.:

gem 'activeadmin-axlsx', require: nil

and adding require "activeadmin-axlsx" to the ActiveAdmin initializer.

randym commented 11 years ago

Hi all,

Sorry for the very long delay.

I've moved all extensions in the gem to kick after_intialize. Can I ask someone to have a go at what is on master and let me know if this fixes the issue in their environment?

randym commented 11 years ago

Sadly mates, I do this in my very limited free time. If you are unsatisfied with the gem, or unwilling to participate in making it better I am sure that you are more than capable of authoring your own custom alternatives.

On the other hand, If you know how much work goes into even making a simple extension like this I hope that you are both kind and mature enough to send in pull requests that solve problems for all developers instead of relying on others to both anticipate and/or empathise with you personal situation.

In the mean time, I will be closing this issue. Hopefully the small change I have made will make life a little bit easier for someone out there who needs to provide xlsx reports for a client but does not have the time or energy to delve into the obtuse specification.

May all your endeavours result in great success!!

rafaeliga commented 11 years ago

sorry, I didnt notice that this will be directly to Github

randym commented 11 years ago

no worries! As soon as i am perfect i wiil have just cause to come down on it for real. in the mean time any help you guys can provide will surely help every oneelse in the community.

rafaeliga commented 11 years ago

@randym,

About one month ago, I fixed the precompile problem, but is a BIG WORKAROUND, so I didnt post here....or create a pull request...

https://github.com/rafaeliga/activeadmin-axlsx/commit/26600fb36c6bf98c5d230452431ab89d45a13034

But, again, Im really sorry if you dont like my comments, I didnt mean "oh man why took soooo long?", I mean "yayyy my ugly workaround is not needed anymore".

randym commented 11 years ago

@rafaeliga no worries.

Let me know if this works in your environment. If it does not, there are a few other things I can try to push the loading of activeadmin-axlsx further down the line of dependencies.