Paperclip

Hi being relatively new to rails I am trying to start a simple project on using paperclip to upload an image file and create a thumbnail.

However I am not sure how to use the rails plug-in? What I did was install paperclip using gem but not sure if this is the right way to go about it.

require 'paperclip' seems to fail.

I also tried

script/plugin install git://github.com/thoughtbot/paperclip.git

I don't see the plugin downloaded when I look in 'vendos/plugin' folder? I get an error when I run the sample code using the following as an example:

http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/

NoMethodError in UsersController#new undefined method `has_attached_file' for #<Class:0x7f645b46a700> RAILS_ROOT: /home/yadav/tmp/rails/PaperclipDemo Application Trace | Framework Trace | Full Trace /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in `method_missing' /home/yadav/tmp/rails/PaperclipDemo/app/models/user.rb:3 /home/yadav/tmp/rails/PaperclipDemo/app/controllers/users_controller.rb:6:in `new'

doing this:

rails testapp

cd testapp

script/plugin install git://github.com/thoughtbot/paperclip.git

you don’t see paperclip in vendor/plugins?

if you do a script/plugin install git://github.com/Shopify/active_merchant.git do you see active_merchant in vendor/plugins?

do you have git installed? if it’s installing these plugins without errors and you’re not seeing them in vendor/plugins that seems very strange

Hi being relatively new to rails I am trying to start a simple project on using paperclip to upload an image file and create a thumbnail.

However I am not sure how to use the rails plug-in? What I did was install paperclip using gem but not sure if this is the right way to go about it.

require 'paperclip' seems to fail.

I also tried

script/plugin install git://github.com/thoughtbot/paperclip.git

I don't see the plugin downloaded when I look in 'vendos/plugin' folder? I get an error when I run the sample code using the following as an example:

Craig White wrote:

Hi being relatively new to rails I am trying to start a simple project on using paperclip to upload an image file and create a thumbnail.

However I am not sure how to use the rails plug-in? What I did was install paperclip using gem but not sure if this is the right way to go about it.

require 'paperclip' seems to fail.

I also tried

script/plugin install git://github.com/thoughtbot/paperclip.git

I don't see the plugin downloaded when I look in 'vendos/plugin' folder? I get an error when I run the sample code using the following as an example:

---- use either gem or plugin, not both

if you use the gem, add to config/environment.rb

  config.gem "paperclip"

Great thanks, got it working!

ben wiseley wrote:

doing this:

rails testapp cd testapp script/plugin install git://github.com/thoughtbot/paperclip.git <http://github.com/thoughtbot/paperclip.git&gt;

<http://github.com/thoughtbot/paperclip.git&gt;you don't see paperclip in vendor/plugins?

if you do a script/plugin install git://github.com/Shopify/active_merchant.git <http://github.com/Shopify/active_merchant.git&gt; do you see active_merchant in vendor/plugins?

do you have git installed? if it's installing these plugins without errors and you're not seeing them in vendor/plugins that seems very strange

Ben thanks for you reply, I realized I didn't have git install, thought I did. I got it working the way Craig said.