Error installing charlock_holmes on rhel5 - ruby-on-rails

I am trying to deploy a rails application that make use of a specific gem, but I cannot succesfully build it:
[git#Porta-Git ~]$ gem install charlock_holmes --version '0.6.9.4'
Building native extensions. This could take a while...
ERROR: Error installing charlock_holmes:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for main() in -licui18n... yes
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... yes
-- tar zxvf file-5.08.tar.gz
-- ./configure --prefix=/usr/local/lib/ruby/gems/2.0.0/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/dst/ --disable-shared --enable-static --with-pic
-- patch -p0 ’ token
transliterator.cpp:108: error: ‘sink’ was not declared in this scope
transliterator.cpp:109: error: ‘class icu_3_6::UnicodeString’ has no member named ‘toUTF8’
make: *** [transliterator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/lib/ruby/gems/2.0.0/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.0.0/extensions/x86_64-linux/2.0.0-static/charlock_holmes-0.6.9.4/gem_make.out
Any suggestion?

Related

Semian gem Gem::Ext::BuildError: ERROR on Ubuntu 20.04

Fresh Ubuntu 20.04 install, when I try to bundle my project, I get this error which I'm not sure what's producing it.
Installing semian 0.10.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/fran/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/semian-0.10.0/ext/semian
/home/fran/.rbenv/versions/2.4.3/bin/ruby -r ./siteconf20200922-5726-1n8pgk.rb extconf.rb --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include
checking for openssl/sha.h... yes
checking for SHA1() in -lcrypto... yes
checking for sys/ipc.h... yes
checking for sys/sem.h... yes
checking for sys/types.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl()... yes
creating Makefile
current directory: /home/fran/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/semian-0.10.0/ext/semian
make "DESTDIR=" clean
current directory: /home/fran/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/semian-0.10.0/ext/semian
make "DESTDIR="
compiling resource.c
In file included from /home/fran/.rbenv/versions/2.4.3/include/ruby-2.4.0/ruby.h:33,
from sysv_semaphores.h:15,
from resource.h:10,
from resource.c:1:
/home/fran/.rbenv/versions/2.4.3/include/ruby-2.4.0/ruby/ruby.h:631:1: error: ‘const’ attribute on function returning ‘void’ [-Werror=attributes]
631 | CONSTFUNC(void rb_secure_update(VALUE));
| ^~~~~~~~~
In file included from /home/fran/.rbenv/versions/2.4.3/include/ruby-2.4.0/ruby/ruby.h:2008,
from /home/fran/.rbenv/versions/2.4.3/include/ruby-2.4.0/ruby.h:33,
from sysv_semaphores.h:15,
from resource.h:10,
from resource.c:1:
/home/fran/.rbenv/versions/2.4.3/include/ruby-2.4.0/ruby/intern.h:257:1: error: ‘const’ attribute on function returning ‘void’ [-Werror=attributes]
257 | CONSTFUNC(void rb_error_untrusted(VALUE));
| ^~~~~~~~~
/home/fran/.rbenv/versions/2.4.3/include/ruby-2.4.0/ruby/intern.h:259:1: error: ‘const’ attribute on function returning ‘void’ [-Werror=attributes]
259 | CONSTFUNC(void rb_check_trusted(VALUE));
| ^~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:242: resource.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/fran/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/semian-0.10.0 for inspection.
Results logged to /home/fran/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0/semian-0.10.0/gem_make.out
An error occurred while installing semian (0.10.0), and Bundler cannot continue.
Make sure that `gem install semian -v '0.10.0' --source 'https://rubygems.org/'` succeeds before bundling.
Did not have this problem bundling other projects that require native extensions, just this one where we make use of the semian gem.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension (ope-rb gem)

I am trying to install this ope-rb gem in my project. Here, the native.c is the gem source program it seems. Since it couldn't find the openssl/rand.h header file, it throws an error. Can anyone tell me what am I missing?
Fetching ope-rb 0.0.1
Installing ope-rb 0.0.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/matheswka/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20180821-27089-1aspxw9.rb extconf.rb
checking for openssl/ssl.h... no
checking for SSLv23_method() in -lssl... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling native.c
native.c:3:10: fatal error: 'openssl/rand.h' file not found
#include <openssl/rand.h>
^~~~~~~~~~~~~~~~
1 error generated.
make: *** [native.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/matheswka/.rvm/gems/ruby-2.2.0#appointments/gems/ope-rb-0.0.1 for inspection.
Results logged to /Users/matheswka/.rvm/gems/ruby-2.2.0#appointments/extensions/x86_64-darwin-14/2.2.0-static/ope-rb-0.0.1/gem_make.out
An error occurred while installing ope-rb (0.0.1), and Bundler cannot continue.
Make sure that `gem install ope-rb -v '0.0.1'` succeeds before bundling.

Installing json -v '1.8.6' gem, throws gcc error

some one in my team just updated some gem in the gemfile because of which gem json is resolved to version '1.8.6'. Which is not being installed. The error it throws is following:
anas:~$ sudo gem install json -v '1.8.6'
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/json-
1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20171017-7274-1ea5ank.rb extconf.rb
creating Makefile
current directory: /var/lib/gems/2.3.0/gems/json-
1.8.6/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /var/lib/gems/2.3.0/gems/json-
1.8.86/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
gcc: error: unrecognized command line option ‘-Wdate-time’
gcc: error: unrecognized command line option ‘-fstack-protector-
strong’
Makefile:239: recipe for target 'generator.o' failed
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /var/lib/gems/2.3.0/gems/json-1.8.6
for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-
linux/2.3.0/json-1.8.6/gem_make.out
My ruby is 2.3.1p112 and gcc version is 4.7.4. I have tried to find out which gcc version json -v 1.8.6 use but I did not find anything.
Thanks in advance
As pr my undarstanding the solution is to install libgmp3-dev.
sudo apt-get install libgmp3-dev

Error installing therubyracer on osx 10.12.4

I have gone through a lot of answers on a similar questions but I have not been successful. I am trying to install therubyracer 0.12.3 on my MAC OSX 10.12.4 and I am receiving the following error. Please help. Been stuck with this for two days now.
sudo gem install therubyracer -v '0.12.3'
Building native extensions.
This could take a while... ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
/Users/aj035785/.rvm/rubies/ruby-2.3.1/bin/ruby -r
./siteconf20170420-2619-13h8man.rb extconf.rb checking for main() in
-lpthread... yes checking for main() in -lobjc... yes creating Makefile
current directory:
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
make "DESTDIR=" clean
current directory:
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
make "DESTDIR=" compiling accessor.cc make:
/usr/local/opt/apple-gcc42/bin/g++-4.2: No such file or directory
make: *** [accessor.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3
for inspection. Results logged to
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-16/2.3.0/therubyracer-0.12.3/gem_make.out
Blockquote
I feel this might be the root cause -
make: /usr/local/opt/apple-gcc42/bin/g++-4.2: No such file or directory

Error installing gem

I typed 'gem install middleman' in my terminal and got the following error message:
Building native extensions. This could take a while...
ERROR: Error installing middleman:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile
make
compiling hitimes.c
make: gcc-4.2: No such file or directory
make: *** [hitimes.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p429/gems/hitimes-1.2.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p429/gems/hitimes-1.2.2/ext/hitimes/c/gem_make.out
Looks like you're missing gcc-4.2
Do you have any GCC installed (if you're on a Mac, you need to install Xcode)?
which gcc
If you already have a version of gcc, you can simply symlink to it
ln -s /usr/bin/gcc /usr/bin/gcc-4.2

Resources