Migrations fails due to missing image


(Kai) #1

Just in case anybody else gets this exception while running migrations with rake db:migrate:

== Seed from /vagrant/db/fixtures/005_users.rb
 - User {:id=>-1, :name=>"system", :username=>"system", :username_lower=>"system", :email=>"no_email", :password=>"36d202888034fd09406a3150762d0dcb", :bio_raw=>"Not a real person. A global user for system notifications and other system tasks.", :active=>true, :admin=>true, :moderator=>true, :email_direct=>false, :approved=>true, :email_private_messages=>false, :trust_level=>4}
sh: 1: convert: not found
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/bin/rake: No such file or directory - convert
rake aborted!
Errno::ENOENT: No such file or directory - tmp/letter_avatars/system/240.png

To fix this just place an image in tmp/letter_avatars/system/240.png and re-run the migrations. The tmp dir is in .gitignore.


(Dan Porter) #2

May this be the issue I’m having here? The log messages don’t show any such message.


(Sam Saffron) #3

What happens if you run convert do you have image magick installed.

I can “fix” this but it means no automatic avatars.


(Kai) #4

That helped :wink:

$ which convert
$ sudo apt-get install imagemagick
$ which convert
/usr/bin/convert
$ rm tmp/letter_avatars/system/240.png
$ RAILS_ENV=test bundle exec rake db:drop db:create db:migrate 

… runs without any exceptions.

I think, Docker needs to handle ImageMagick install. I’ll look into this.
To install ImageMagick on the Vagrant Box a new chef recipe is needed that handles apt-get install imagemagick.


(Kai) #5

https://github.com/discourse/discourse/pull/2394