I'm trying to create an Ruby on Rails "Hello World" application on our managed server where no root or sudo
is possible.
Ruby is version 2.3.3p222, Rails is v5.2.4.1.
I used rails new testproject
to create my "Hello World" test. This fails in bundle install
because I can't install in the system gems getting
Error "Your user account isn't allowed to install to the system RubyGems"
Going to the testproject
folder and entering:
bundle install --path ~/.gem
returns:
This failed with *"An error occurred while installing sqlite3 (1.4.2),
and Bundler cannot continue."*
The reason is an compiler error: *"conftest.c:13:57: error:
‘pthread_create’ undeclared (first use in this function)"* Problem:
The compiler can't find pthread because the *pthread.h* not included.
The only include in the conftest.c is *#include "ruby.h"* and this is
included from the system includes.
I extracted the gcc command from the logfile, changed the order of the include folders so my local include folder is now first. I placed a dummy "ruby.h" in my local include, that includes the "pthread.h" and the "ruby.h" from the system include folder.
The new gcc command is:
gcc -o conftest -I/usr/home/admin/include -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.3-LPgLkQ/ruby2.3-2.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DTAINTING_SUPPORT conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lruby-2.3 -lfalse -lpthread -lgmp -ldl -lcrypt -lm -lc
New error now:
cannot find -lfalse
When I remove the -lfalse
from the gcc command I get no more errors.
So now I know that the missing include for "pthread.h" is my first problem. And the -lfalse
is the second one. But how can I solve this?
How can I tell bundle install
to include the pthread.h?
Why is there an -lfalse
?
I took me some hours to get to this point but I've no idea how to continue now.