0
votes

I'm trying to use both of PaperClip and ActiveScaffold with help of as_paperclip_bridge in a rails3.0.5 project.

However, following initialization error is occurred when I launch the project.

=> Booting WEBrick => Rails 3.0.5 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting C:/Users/ken/Documents/NetBeansProjects/fcheck/vendor/plugins/as_paperclip_bridge/init.rb:10: undefined method bridge' for ActiveScaffold:Module (NoMethodError) from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/plugin.rb:81 from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:ininstance_exec' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in run' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:inrun_initializers' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in each' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:inrun_initializers' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in initialize!' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:insend' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in method_missing' from C:/Users/ken/Documents/NetBeansProjects/fcheck/config/environment.rb:7 from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:inrequire' from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in require' from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:inload_dependency' from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in new_constants_in' from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:inload_dependency' from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in require' from C:/Users/ken/Documents/NetBeansProjects/fcheck/config.ru:3 from C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46:ininstance_eval' from C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46:in initialize' from C:/Users/ken/Documents/NetBeansProjects/fcheck/config.ru:1:innew' from C:/Users/ken/Documents/NetBeansProjects/fcheck/config.ru:1

The code in as_paperclip_bridge\init.rb is attempting to call a module method 'ActiveScaffold.bridge' but it coun't be found. Even though, same code is working without error in rails2.3.8 project.

We can see a big difference of rails initialization code between version 2 and 3.

On rails 2.3.8, plugins are loaded in 'load_plugins' method which is called after 'load_gems' method in initializer.rb. However, rails3 doesn't have initializer.rb and the loading process seems to be totally different.

I also have tried to remove AS gem and install both of AS plugin with as_paperclip_bridge plugin. But, the error haven't disappeared.

Could someone explain why the error is occurring?!

Anyway, I really hope to get any solution or workaround.

Thanks, Kenichi

1

1 Answers

0
votes

Self reply.

I had realized that as_paperclip_bridge was not required for latest ActiveScaffold implementation. (It's including the bridge)

Please make sure to install ImageMagick and RMagick gem to use PaperClip for image files. Or, you may also think 'as_paperclip_bridge should be there'

Thank you, Kenichi