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.
Related
Trying to deploy Rails app onUbuntu 20 is impossible to install pg, and any attempt to bundle will incur in errors
$ gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /home/user/.rvm/gems/ruby-2.6.1/gems/pg-1.2.3/ext
/home/user/.rvm/rubies/ruby-2.6.1/bin/ruby -I /home/user/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210417-119158-37ke72.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQsetSingleRowMode()... yes
checking for PQconninfo()... yes
checking for PQsslAttribute()... yes
checking for PQresultVerboseErrorMessage()... yes
checking for PQencryptPasswordConn()... yes
checking for PQresultMemorySize()... yes
checking for timegm()... yes
checking for rb_gc_adjust_memory_usage()... yes
checking for unistd.h... yes
checking for inttypes.h... yes
checking for C99 variable length arrays... yes
creating extconf.h
creating Makefile
current directory: /home/user/.rvm/gems/ruby-2.6.1/gems/pg-1.2.3/ext
make "DESTDIR=" clean
current directory: /home/user/.rvm/gems/ruby-2.6.1/gems/pg-1.2.3/ext
make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
compiling pg_binary_decoder.c
compiling pg_binary_encoder.c
compiling pg_coder.c
compiling pg_connection.c
compiling pg_copy_coder.c
compiling pg_errors.c
compiling pg_record_coder.c
compiling pg_result.c
compiling pg_text_decoder.c
compiling pg_text_encoder.c
compiling pg_tuple.c
compiling pg_type_map.c
compiling pg_type_map_all_strings.c
compiling pg_type_map_by_class.c
compiling pg_type_map_by_column.c
compiling pg_type_map_by_mri_type.c
compiling pg_type_map_by_oid.c
compiling pg_type_map_in_ruby.c
compiling pg_util.c
linking shared-object pg_ext.so
current directory: /home/user/.rvm/gems/ruby-2.6.1/gems/pg-1.2.3/ext
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:201: .sitearchdir.time] Error 127
make install failed, exit code 2
Gem files will remain installed in /home/user/.rvm/gems/ruby-2.6.1/gems/pg-1.2.3 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.6.1/extensions/x86_64-linux/2.6.0/pg-1.2.3/gem_make.out
on bundle install nothing seem to work:
An error occurred while installing bcrypt (3.1.16), and Bundler cannot continue.
Make sure that gem install bcrypt -v '3.1.16' --source 'https://rubygems.org/' succeeds before bundling.
In Gemfile:
bcrypt
An error occurred while installing nio4r (2.5.7), and Bundler cannot continue.
Make sure that gem install nio4r -v '2.5.7' --source 'https://rubygems.org/' succeeds before bundling.
In Gemfile:
rails was resolved to 6.1.3.1, which depends on
actioncable was resolved to 6.1.3.1, which depends on
nio4r
An error occurred while installing racc (1.5.2), and Bundler cannot continue.
Make sure that gem install racc -v '1.5.2' --source 'https://rubygems.org/' succeeds before bundling.
Nothing seems to work and there is not useful information on how to solve problem
make: /usr/bin/mkdir: Command not found it's the reason.
Please write this command with sudo perm.
sudo ln -s $(which mkdir) /usr/bin/mkdir
And try again bundle.
This happens because you need install the following packages that the pg gem requires:
sudo apt install postgresql postgresql-contrib libpq-dev
Then configure postgres and verify is running.
I'm trying to install Rails on my new machine, and I keep getting this error when bundling.
An error occurred while installing puma (4.3.5), and Bundler cannot
continue.
Make sure that `gem install puma -v '4.3.5' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
puma
When I run gem install puma -v '4.3.5' --source 'https://rubygems.org/, I get this error:
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
current directory: /Users/christopherdavis/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5/ext/puma_http11
/Users/christopherdavis/.rbenv/versions/2.7.1/bin/ruby -I /Users/christopherdavis/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0 -r ./siteconf20200829-23175-2h0q0u.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
checking for DTLS_method() in openssl/ssl.h... yes
checking for TLS_server_method() in openssl/ssl.h... yes
checking for SSL_CTX_set_min_proto_version in openssl/ssl.h... yes
creating Makefile
current directory: /Users/christopherdavis/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5/ext/puma_http11
make "DESTDIR=" clean
current directory: /Users/christopherdavis/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
ext/puma_http11/http11_parser.c:44:18: warning: unused variable 'puma_parser_en_main' [-Wunused-const-variable]
static const int puma_parser_en_main = 1;
^
1 warning generated.
compiling io_buffer.c
compiling mini_ssl.c
mini_ssl.c:145:7: warning: unused variable 'min' [-Wunused-variable]
int min, ssl_options;
^
mini_ssl.c:299:40: warning: function 'raise_error' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
void raise_error(SSL* ssl, int result) {
^
2 warnings generated.
compiling puma_http11.c
puma_http11.c:203:22: error: implicitly declaring library function 'isspace' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
while (vlen > 0 && isspace(value[vlen - 1])) vlen--;
^
puma_http11.c:203:22: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
1 error generated.
make: *** [puma_http11.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/christopherdavis/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5 for inspection.
Results logged to /Users/christopherdavis/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-20/2.7.0/puma-4.3.5/gem_make.out
Has anyone seen this before? How might I fix the issue? I'm new to Rails and unsure of what's going on. I followed the tutorial on GoRails and found myself here.
Thanks!
See https://github.com/puma/puma/pull/2314
Run this line...
bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"
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.
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
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?