10/21/2016

Gitlab on FreeBSD: Upgrading the port tree causes Shared object "libicui18n.so.55" not found, required by "charlock_holmes.so"

If you are just blindly updating FreeBDS's port tree with

portmaster --no-confirm -aD

Gitlab may fail to start due to a newer version of icui18n.so installed on the system, failing to find the old one.

This is how the error manifests itself:

# less ~/gitlab/log/unicorn.stderr.log

/usr/home/git/gitlab/vendor/bundle/ruby/2.2/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in `require': Shared object "libicui18n.so.55" not found, required by "charlock_holmes.so" - /usr/home/git/gitlab/vendor/bundle/ruby/2.2/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes/charlock_holmes.so (LoadError)
        from /usr/home/git/gitlab/vendor/bundle/ruby/2.2/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in `block in require'
        from /usr/home/git/gitlab/vendor/bundle/ruby/2.2/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:232:in `load_dependency'
        from /usr/home/git/gitlab/vendor/bundle/ruby/2.2/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in `require'
...

The fix is to reinstall the charlock_holmes gem, and then gitlab-shell:

cd gitlab
bundle exec gem uninstall charlock_holmes
bundle install
bundle exec rake gitlab:shell:setup RAILS_ENV=production

Then start gitlab (obviously with sudo rights):

service gitlab start

Feel free to drop a line below if the fix worked for you. Cheers!

References:

https://github.com/brianmario/charlock_holmes/issues/48

https://github.com/brianmario/charlock_holmes/issues/7

9/10/2016

Redmine fails to start: There was an error while trying to load the gem 'rbpdf'. Gem Load Error is: This installation of RMagick was configured with ImageMagick 6.9.4 but ImageMagick 6.9.5-5 is in use.

After redmine is installed and FreeBSD's package-tree was updated, Redmine did not start (with some nginx error in the browser), and investigating the error log:
less /var/log/nginx/error.log
...
  Message from application: There was an error while trying to load the gem 'rbpdf'.

Gem Load Error is: This installation of RMagick was configured with ImageMagick 6.9.4 but ImageMagick 6.9.5-5 is in use.

Backtrace for gem load error is:

/usr/local/lib/ruby/gems/2.2/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `require'

/usr/local/lib/ruby/gems/2.2/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `block in require'

/usr/local/lib/ruby/gems/2.2/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:240:in `load_dependency'

/usr/local/lib/ruby/gems/2.2/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `require'
...
led to the conclusion that we need to reinstall things here. So tried a remove of the concerned modules, and reinstalled the bundle:
cd /usr/local/www/redmine
gem uninstall rmagick
gem uninstall rpdf
bundle install
service nginx restart
And voila, redmine is back online.