Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Can't install the gem #13

Closed
theonegri opened this issue Dec 18, 2014 · 5 comments
Closed

Can't install the gem #13

theonegri opened this issue Dec 18, 2014 · 5 comments

Comments

@theonegri
Copy link

Hello.
When I try to install the gem I'm getting the following error:

➜  repo git:(staging) ✗ rails generate paperclip_optimizer:install
/Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.0/lib/image_optim/railtie.rb:18:in `options': undefined local variable or method `app' for #<ImageOptim::Railtie:0x00000107b626e8> (NameError)
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.0/lib/image_optim/railtie.rb:26:in `register_preprocessor'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.0/lib/image_optim/railtie.rb:7:in `block in <class:Railtie>'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `run'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/application.rb:300:in `initialize!'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/railtie.rb:194:in `public_send'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/railtie.rb:194:in `method_missing'
    from /Users/theonegri/Work/jobsintech/config/environment.rb:5:in `<top (required)>'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/application.rb:276:in `require_environment!'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:147:in `require_application_and_environment!'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:133:in `generate_or_destroy'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:51:in `generate'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Here is the rails en ruby version I'm using:

➜  repo git:(staging) ✗ rails -v
Rails 4.1.8
➜  repo git:(staging) ✗ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
@janfoeh
Copy link
Owner

janfoeh commented Dec 18, 2014

Hi Theo,

just a quick note since I'm on the go - that looks to be a bug in image-optim 0.20. Try uninstalling it, then explicitly add version 0.19 in your Gemfile.

On 18.12.2014, at 13:12, Theo Negri [email protected] wrote:

Hello.
When I try to install the gem I'm getting the following error:

➜ repo git:(staging) ✗ rails generate paperclip_optimizer:install
/Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.0/lib/image_optim/railtie.rb:18:in options': undefined local variable or methodapp' for #ImageOptim::Railtie:0x00000107b626e8 (NameError)
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.0/lib/image_optim/railtie.rb:26:in register_preprocessor' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.0/lib/image_optim/railtie.rb:7:inblock in class:Railtie'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:30:in instance_exec' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:30:inrun'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:55:in block in run_initializers' from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:226:inblock in tsort_each'
from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:348:in block (2 levels) in each_strongly_connected_component' from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:427:ineach_strongly_connected_component_from'
from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:347:in block in each_strongly_connected_component' from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:ineach'
from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:in call' from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:ineach_strongly_connected_component'
from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:224:in tsort_each' from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:205:intsort_each'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:54:in run_initializers' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/application.rb:300:ininitialize!'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/railtie.rb:194:in public_send' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/railtie.rb:194:inmethod_missing'
from /Users/theonegri/Work/jobsintech/config/environment.rb:5:in <top (required)>' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:inrequire'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in block in require' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:inload_dependency'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in require' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/application.rb:276:inrequire_environment!'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:147:in require_application_and_environment!' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:133:ingenerate_or_destroy'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:51:in generate' from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:inrun_command!'
from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands.rb:17:in <top (required)>' from bin/rails:4:inrequire'
from bin/rails:4:in `

'
Here is the rails en ruby version I'm using:

➜ repo git:(staging) ✗ rails -v
Rails 4.1.8
➜ repo git:(staging) ✗ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]

Reply to this email directly or view it on GitHub.

@janfoeh
Copy link
Owner

janfoeh commented Dec 18, 2014

I have opened a pull request with the fix at toy/image_optim/pull/72

@theonegri
Copy link
Author

Thanks for the fast update.
I updated to the 0.20.1 version but I got this error:

➜  repo git:(staging) ✗ rails generate paperclip_optimizer:install
/Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.1/lib/image_optim/worker/class_methods.rb:72:in `create_all': Bin resolving errors: (ImageOptim::BinResolver::Error)
pngout worker: `pngout` not found; please provide proper binary or disable this worker (--no-pngout argument or `:pngout => false` through options)
svgo worker: `svgo` not found; please provide proper binary or disable this worker (--no-svgo argument or `:svgo => false` through options)
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.1/lib/image_optim/worker/class_methods.rb:44:in `create_all_by_format'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.1/lib/image_optim.rb:77:in `initialize'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.1/lib/image_optim/railtie.rb:26:in `new'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.1/lib/image_optim/railtie.rb:26:in `register_preprocessor'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/image_optim-0.20.1/lib/image_optim/railtie.rb:7:in `block in <class:Railtie>'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `run'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /Users/theonegri/.rvm/rubies/ruby-2.1.1-railsexpress/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/application.rb:300:in `initialize!'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/railtie.rb:194:in `public_send'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/railtie.rb:194:in `method_missing'
    from /Users/theonegri/Work/jobsintech/config/environment.rb:5:in `<top (required)>'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/application.rb:276:in `require_environment!'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:147:in `require_application_and_environment!'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:133:in `generate_or_destroy'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:51:in `generate'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /Users/theonegri/.rvm/gems/ruby-2.1.1-railsexpress/gems/railties-4.1.8/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'
➜  repo git:(staging) ✗

@janfoeh
Copy link
Owner

janfoeh commented Dec 19, 2014

That again is from image_optim. A quick copy & paste:

image_optim inserts itself into the asset pipeline and tries to compress your applications image assets as well. Since it enables all libraries it supports by default, you might suddenly run into errors if you do not have all of them installed.

Please note: image_optim settings made through PaperclipOptimizer do not apply here.

To disable image_optim in your asset pipeline, add

# config/application.rb
config.assets.image_optim = false

to your config/application.rb.

@janfoeh
Copy link
Owner

janfoeh commented Dec 22, 2014

I assume it's working now — let me know if the issue remains.

@janfoeh janfoeh closed this as completed Dec 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants