Paperclip ‘identify’ command error on ubuntu.

Hello,
Playing to resolve the ‘identify’ command error during paperclip implementation.

Try running which identify and setting the option to be the directory that is returned like identify is hashed (/usr/bin/identify).

If that command doesn’t return anything, make sure that ImageMagick is properly installed.

If not installed then run following command and install it.

sudo apt-get install imagemagick

sudo apt-get install libmagickwand-dev

gem install rmagick

Then set Paperclip.options[:command_path] = “/usr/bin” in development.rb file

Implement Delayed Job with rails

Rubies,
Wanna to implement background job with rails application? than use delayed job. https://github.com/collectiveidea/delayed_job

To install delayed job either via plugin or gem.

environment.rb file mention
config.gem ‘delayed_job’

on command prompt:
gem install delayed_job

rake generate delayed_job

rake db:migrate

Now in create custom job interface by adding custom ruby code.

class EmailJob < Struct.new(:args)
def perform
args[:emails].each { |e| AppMailer.deliver_text_to_email(args[:content], e) }
end
end

To invoke above job using below command.
Delayed::Job.enqueue EmailJob.new('Invitation to join ruby conference at india !!', User.all.collect(&:email))

Once you invoke the above statement it will create the delayed job but than we need to execute it by using delayed_job inbuilt rake task.

rake jobs:work

Oops! will you find error? No such rake found etc..? Hmm.. Do you know what are you missing?
Let me give you hint.

– Above error indicate delayed_job's tasks are not loaded with you rails. So for that we have modify application's Rakefile.

Refer http://priyanka-railsdeveloper.blogspot.in/2012/06/jobswork-fails.html

Hope, This article will be useful.