Ruby on Rails + Papercliip: cannot load such file — cocaine (LoadError)

Estoy usando Paperclip para asociar adjuntos y al generar el modelo casca este error :
[shell]
$ rails generate paperclip pet photo
/var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require’: cannot load such file — cocaine (LoadError)
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require’
from /home/jorge/Proyects/Clientes/elcielodelosgatos/vendor/plugins/paperclip/lib/paperclip.rb:45:in `
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency’
from /var/lib/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require’
from /home/jorge/Proyects/Clientes/elcielodelosgatos/vendor/plugins/paperclip/init.rb:1:in `block in
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/plugin.rb:81:in `eval’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/plugin.rb:81:in `block in

from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:83:in `require’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:83:in `require_environment!’
from /var/lib/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:22:in `
from script/rails:6:in `require’
from script/rails:6:in `


[/shell]

Para solucionarlo, hay que instalar la gema cocaine ( A small library for doing (command) lines )

[shell]
gem install cocaine
[/shell]

Sige apareciendo el error así que hay que agregarlo a Gemfile
[shell]
echo «gem ‘cocaine'» >> Gemfile
[/shell]

y ya funciona.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

 

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.