emrekutlu / paperclip-compression

image compression processor for Paperclip
MIT License
72 stars 37 forks source link

Rails 4.1.rc2 app won't boot #7

Closed erikdahlstrand closed 8 years ago

erikdahlstrand commented 10 years ago

Hi,

With 'paperclip-compression' in my Gemfile the rails app won't boot.

I get the following error when starting the web server

$ rails s
.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/parser-2.1.7/lib/parser/ruby21.rb:13:in `<top (required)>': undefined method `check_for_encoding_support' for Parser:Module (NoMethodError)
emrekutlu commented 10 years ago

I can't reproduce this. Did you check parser gem? It seems like parser gem causes the problem.

erikdahlstrand commented 10 years ago

Ah, sorry! For some reason I assumed that the parser gem is a dependency of the paperclip-compression gem. But parser is a dependency of rubocop which is also in my Gemfile. When removing rubocop the application boots with no errors.

I.e. this combination do not work. At least not for me. I don't know if it's a paperclip-compression or rubocop issue?

gem 'paperclip-compression'

group :development do
  gem 'rubocop'
end
emrekutlu commented 10 years ago

Ok, I think I found the problem. paperclip-compression is dependent to ruby-imagespec and ruby-imagespec has a module named Parser without any namespace.

It is a little bit hacky way but can you please change the order in Gemfile and let me know if it works.

group :development do
  gem 'rubocop'
end

gem 'paperclip-compression'
erikdahlstrand commented 10 years ago

Yes, is works. That's a work around for now. Thanks.

JamesChevalier commented 9 years ago

Another potential workaround is to change the line in Gemfile to:

gem 'rubocop', require: false

This worked in my quick test - Rails would start, and rubocop would run. I haven't gotten around to extensive testing beyond that, though.

(For anyone unfamiliar with require: false, it tells Rails not to automatically load that gem on startup. When this is used, you need to use its require line to load the gem where you'll use it. A good example of how this is used is simplecov.)

uiltondutra commented 8 years ago

The ruby-imagespec dependency was removed. I think this discussion can be closed.

emrekutlu commented 8 years ago

Yes, I am closing it. Actually I should close with the previous version, sorry about that.