Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to install the clamav gem on Mac OS X with boxen & homebrew installed clamav. Inspired by:
# /opt/boxen/repo/modules/projects/manifests/your_project.pp
# Install with: boxen your_project
# When you're using boxen DO NOT install clamav directly with: brew install clamav
# It won't link the header files correctly.
include homebrew
class projects::your_project {
notify { 'Setting up Your Project': }
package {
$ gem install clamav
Fetching: clamav-0.4.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing clamav:
ERROR: Failed to build gem native extension.
/opt/boxen/rbenv/versions/1.9.3-p392/bin/ruby extconf.rb
checking for clamav.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
Gem files will remain installed in /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/clamav-0.4.1 for inspection.
Results logged to /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/clamav-0.4.1/ext/clamav/gem_make.out
$ gem install clamav -- --with-clamav-include=/opt/boxen/homebrew/include/ --with-clamav-lib=/opt/boxen/homebrew/lib
Building native extensions. This could take a while...
Successfully installed clamav-0.4.1
1 gem installed
~/git/curate_nd master $ irb
irb(main):001:0> require 'clamav'
=> true
irb(main):002:0> a = ClamAV.instance
=> #<ClamAV:0x007ff3ab1e89c0>
irb(main):003:0> a.loaddb
LibClamAV Error: cli_loaddb(): No supported database files found in /opt/boxen/homebrew/Cellar/clamav/0.97.8/share/clamav
RuntimeError: cl_load() error: Can't open file or directory
from (irb):3:in `loaddb'
from (irb):3
from /opt/boxen/rbenv/versions/1.9.3/bin/irb:12:in `<main>'
irb(main):004:0> a.scanfile('/tmp/')
=> 8
irb(main):005:0> a.scanfile('/tmp/1')
=> 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.