2

When doing:

sudo gem install charlock_holmes

I get the following error:

Failed to build gem native extension

I have tried: sudo apt-get install libicu-dev as suggested by various internet sources.

However, this gives me the following error:

E: Unable to locate package libicu-dev

A quick look in synaptic shows I have libicu48.

The documentation suggest to use the following:

bundle config build.charlock_holmes --with-icu-dir=/path/to/installed/icu4c Or:

gem install charlock_holmes -- --with-icu-dir=/path/to/installed/icu4c

However, I'm not sure where /path/to/installed/icu4c is.

Harry
  • 2,429
  • 4
  • 21
  • 26
  • How did you go, any luck with this or any tips you can share with those who follow behind you? – Evolve Feb 05 '14 at 03:26
  • No sorry, I actually forget what this was for. I have experienced problems with retrieving certain packages (php-pear, php-mbstring, etc) so I suspect it's related to that. – Harry Feb 05 '14 at 13:00
  • Commonly people are having issues with this when installing Gollum wiki or Gitlab. If you are no longer seeking an answer and since there is no other advice here and this question is asked elsewhere, you might want to delete the question. Unless you still want it answered? – Evolve Feb 05 '14 at 22:05

1 Answers1

0

Forget the documented suggestion, you don't need to use that approach to point to the ICU path. To get the charlock_holmes gem working you need to pass a number of flags using bundle config.

Run the following from the command line within the project folder:

$ mkdir .bundle    
$ bundle config --local build.charlock_holmes --with-ldflags='-L. -Wl,-O1 -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,--no-undefined -lz -licuuc'

Commit the newly created file (/.bundle/config) to version control and redeploy.

This solution based largely on advice I received from Engine Yard support who also referenced from within the projects github issues. https://github.com/brianmario/charlock_holmes/issues/32#issuecomment-17033186

Evolve
  • 8,939
  • 12
  • 51
  • 63
  • Isn't it an exact duplicate of your [earlier answer](http://stackoverflow.com/questions/21568592/deploy-gollum-wiki-with-engine-yard/21847417#21847417)? – Paresh Mayani Feb 24 '14 at 06:16
  • Sure! And after days of searching and wasted time Ive come back to the places on the net where people have been dealing with exactlty the same problem and posting the answer. I hunted for ages to get this answer and want to make sure others find it when they come across questions like these. I already suggested this poster close their unanswered question, and since they haven't I have now posted a valid answer. I don't believe answers need to be unique/reworded to be correct. – Evolve Feb 24 '14 at 07:41
  • Ok Ive updated my post to address the users question more directly before giving the answer. – Evolve Feb 24 '14 at 07:45
  • Agree with your valid point. Let's leave it to SO moderators as it might be flagged as duplicate answer (not sure but still). – Paresh Mayani Feb 24 '14 at 07:47
  • This does not work for me. I still get the "libz missing" error. Once you do the bundle config, do you just call: gem install charlock_holmes -v '0.7.3' ? Or do you call gem install with more parameters? – Paul Chernoch Apr 30 '15 at 15:44
  • 1
    I also needed to do this first: sudo apt-get install zlib1g-dev. Then everything worked. – Paul Chernoch Apr 30 '15 at 16:03
  • @PaulChernoch props for coming back here and posting an answer to your question. Hopefully this all helps the next poor person down this path, and if so they add a +1 to the question & answer. – Evolve May 04 '15 at 08:48