I removed installed ruby: sudo apt-get purge ruby
and I Download and compile ruby:
wget http://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.gz
tar -xzvf ruby-1.8.7-p374.tar.gz
cd ruby-1.8.7-p374
./configure
AND Build a MakeFile using the specific compiler.
make CC=gcc-4.4
An error occurred when compiling.
Error in compiling openssl
compiling openssl
make[1]: 디렉터리 '/ruby-1.8.7-p374/ext/openssl' 들어감
gcc-4.4 -I. -I../.. -I../../. -I../.././ext/openssl -
DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -g -O2 -c ossl_hmac.c
In file included from ossl.h:57,
from ossl_hmac.c:13:
/usr/include/openssl/asn1_mac.h:10: error: #error "This file is obsolete;
please update your software."
In file included from ossl.h:205,
from ossl_hmac.c:13:
openssl_missing.h:79: error: macro "EVP_MD_CTX_create" passed 1 arguments, but takes just 0
openssl_missing.h:83: error: expected declaration specifiers or ‘...’ before ‘(’ token
openssl_missing.h:83: error: conflicting types for ‘EVP_MD_CTX_reset’
/usr/include/openssl/evp.h:498: note: previous declaration of
‘EVP_MD_CTX_reset’ was here
openssl_missing.h:91: error: expected declaration specifiers or ‘...’ before ‘(’ token
ossl_hmac.c: In function ‘ossl_hmac_alloc’:
ossl_hmac.c:54: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’
ossl_hmac.c:54: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’ `enter code here`
ossl_hmac.c: In function ‘ossl_hmac_initialize’:
ossl_hmac.c:73: warning: ‘HMAC_Init’ is deprecated (declared at /usr/include/openssl/hmac.h:28)
ossl_hmac.c: In function ‘hmac_final’:
ossl_hmac.c:114: error: storage size of ‘final’ isn’t known
ossl_hmac.c: In function ‘ossl_hmac_reset’:
ossl_hmac.c:182: warning: ‘HMAC_Init’ is deprecated (declared at /usr/include/openssl/hmac.h:28)
Makefile:197: recipe for target 'ossl_hmac.o' failed
make[1]: *** [ossl_hmac.o] Error 1
make[1]: DIR '/ruby-1.8.7-p374/ext/openssl' 나감
Makefile:293: recipe for target 'all' failed
make: *** [all] Error 1`
How can i resolve this error..
I ran into a very similar error installing 1.9.3 on Ubuntu 18.04. I did the following to get around it -
sudo apt install libssl1.0-dev
and then rebuilt Ruby.
Related
I am on android 7.1 running termux. I have recently installed rbenv to install ruby 2.7.2. Since the new ruby 3.0 release most of the tools have been broken. Ex:Metasploit. I have all the required dependencies. I have tried rbenv install 2.7.2 and RUBY_CONFIGURE_OPTS=--disable-install-doc rbenv install 2.7.2. It gives me this error when I type rbenv install 2.7.2`
ERROR:
Downloading ruby-2.7.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.bz2
Installing ruby-2.7.2...
BUILD FAILED (Linux 3.10.49-gd9886247 using ruby-build 20210119)
Inspect or clean up the working tree at /data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E
Results logged to /data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.log
Last 10 log lines:
linking miniruby
rb_mjit_header.h updated
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:51: undefined reference to `makecontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize_main':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:32: undefined reference to `getcontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_transfer':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:59: undefined reference to `swapcontext'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:271: miniruby] Error 1
I have gave up after trying to fix this after 4 hours.
Here is the log file
compiling array.c
compiling mjit.c
WARNING: linker: /data/data/com.termux/files/home/.rbenv/versions/2.5.3/bin/ruby: unsupported flags DT_FLAGS_1=0x8000001
compiling coroutine/ucontext/Context.c
In file included from coroutine/ucontext/Context.c:14: coroutine/ucontext/Context.h:32:5: warning: implicitly declaring library function 'getcontext' with type 'int (ucontext_t *)' (aka 'int (struct ucontext *)') [-Wimplicit-function-dec
laration] getcontext(&context->state); ^
coroutine/ucontext/Context.h:32:5: note: include the header <setjmp.h> or explicitly provide a declaration for 'getcontext' coroutine/ucontext/Context.h:51:5: warning: implicit declaration of function 'makecontext' is invalid in C99 [-Wimplicit-function-declaration]
makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context);
^
coroutine/ucontext/Context.h:59:5: warning: implicit declaration of function 'swapcontext' is invalid in C99 [-Wimplicit-function-declaration]
swapcontext(¤t->state, &target->state);
^
3 warnings generated.
compiling enc/ascii.c
compiling enc/us_ascii.c
compiling enc/unicode.c compiling enc/utf_8.c
compiling enc/trans/newline.c
./revision.h unchanged
compiling version.c
1 warning generated.
building rb_mjit_header.h
linking miniruby
rb_mjit_header.h updated
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:51: undefined reference to `makecontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize_main':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:32: undefined reference to `getcontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_transfer':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:59: undefined reference to `swapcontext'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:271: miniruby] Error 1
I have no idea what to do. I am a noob , So please explain what to do and THANKS in advance.
websocket via gem install em-websocket. Got this error:
compiling binder.cpp
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
In file included from binder.cpp:20:0:
project.h:25:20: fatal error: iostream: No such file or directory
compilation terminated.
Makefile:233: recipe for target 'binder.o' failed
make: *** [binder.o] Error 1
make failed, exit code 2
...
How to deal with this?
iostream was introduced in libstc++-6.Installing libstdc++6-4.4-dev by sudo apt-get install libstdc++6-4.4-dev. it will delete currently installed g++.Then run sudo apt-get install g++.This solved my problem.
I am using link :https://elinux.org/RPi_U-Boot.
This is my snapshot:
$ export CROSS_COMPILE=/scratch/rpi-tools/arm-bcm2708/arm
bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-
pranav#abc:/scratch/u-boot$ export USE_PRIVATE_LIBGCC=yes
pranav#abc:/scratch/u-boot$ sudo make rpi_3_defconfig
upto this compiled successfully.Next stage gives error
pranav#abc:/scratch/u-boot$ sudo make -j3
scripts/kconfig/conf --silentoldconfig Kconfig
GEN include/autoconf.mk.dep
cc1: warning: unknown register name: x18
cc1: warning: unknown register name: x18
warning: unable to access '/home/pranav/.config/git/attributes':
Permission denied
cc1: warning: unknown register name: x18
cc1: warning: unknown register name: x18
cc1: error: bad value (‘armv8-a’) for ‘-march=’ switch
cc1: error: bad value (‘armv8-a’) for ‘-march=’ switch
cc1: note: valid arguments to ‘-march=’ switch are: nocona core2
make[1]: *** [lib/asm-offsets.s] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/lib/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
After this I used:
$ export CROSS_COMPILE=aarch64-linux-gnu-
But then also giving some error.
CROSS_COMPILE=/scratch/rpi-tools/arm-bcm2708/arm
bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-
relates to a 32bit compiler.
The defconfig you are using is for 64-bit. So you have to install a 64-bit toolchain and then to specify CROSS_COMPILE to match the cross-building tools that you have installed.
On Debian, Ubuntu, or Mint you would use
sudo apt-get install gcc-aarch64-linux-gnu
export CROSS_COMPILE aarch64-linux-gnu-
I want to install gitlab, which don't recommend to use any ruby version manager.
But
This is my OS Linux dqa-dev 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux
linking shared-object psych.so
installing default psych libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/psych'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/pty'
compiling pty.c
pty.c: In function 'chfunc':
pty.c:143:12: warning: ignoring return value of 'seteuid', declared with attribute warn_unused_result [-Wunused-result]
seteuid(getuid());
^
linking shared-object pty.so
installing default pty libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/pty'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/racc/cparse'
compiling cparse.c
linking shared-object racc/cparse.so
installing default cparse libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/racc/cparse'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/readline'
compiling readline.c
readline.c: In function 'Init_readline':
readline.c:1886:26: error: 'Function' undeclared (first use in this function)
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c:1886:26: note: each undeclared identifier is reported only once for each function it appears in
readline.c:1886:36: error: expected expression before ')' token
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c: At top level:
readline.c:530:1: warning: 'readline_pre_input_hook' defined but not used [-Wunused-function]
readline_pre_input_hook(void)
^
make[2]: *** [readline.o] Error 1
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/readline'
make[1]: *** [ext/readline/all] Error 2
make[1]: Leaving directory `/home/poc/ruby-2.0.0-p451'
make: *** [build-ext] Error 2
I also have Ubuntu 14.04 and I got to make it work. Sharing what I did just in case it works for you.
I patched the file ext/readline/readline.c replacing line 1886:
rl_pre_input_hook = (Function *)readline_pre_input_hook;
With
rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
Then I tried to make it again and it worked.
Source: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741825
I also ran into this issue trying to install ruby-2.0.0-p247 with rbenv. Save some time by using this patch.
You can run it like this:
curl -fsSL https://gist.github.com/ference/d3d4cbbe18309a91ad9b/raw/267ea89fa145c536967831e1af4dea030297b53e/ruby-2.0.0-p247.patch | rbenv install --patch 2.0.0-p247
This is my solution on Ubuntu 14.04 Server edition.
I need to install underline
sudo apt-get install libreadline6 libreadline6-dev
Then, the problem was fixed.
Found a solution from https://github.com/sstephenson/ruby-build/issues/690. What actually missing is libffi-dev. I tried on Ubuntu 12.04 and it is successful.
sudo apt-get install libffi-dev
I am trying to compile imapfilter 2.4.1 ( https://github.com/lefcha/imapfilter ) in CentOS 5.6. I believe I've got all the dependencies sorted but when I run make I get:
make[1]: Entering directory `/home/src/imapfilter-2.4.1/src'
cc -Wall -O -DMAKEFILE_SHAREDIR='"/usr/local/share/imapfilter"' -c -o core.o core.c
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
core.c: In function ‘ifcore_append’:
core.c:947: warning: implicit declaration of function ‘lua_strlen’
core.c: In function ‘luaopen_ifcore’:
core.c:1162: warning: implicit declaration of function ‘luaL_register’
core.c:1162: error: ‘ifcorelib’ undeclared (first use in this function)
core.c:1162: error: (Each undeclared identifier is reported only once
core.c:1162: error: for each function it appears in.)
make[1]: *** [core.o] Error 1
make[1]: Leaving directory `/home/src/imapfilter-2.4.1/src'
make: *** [all] Error 2
Based on other user comments and file revision dates I am sure this should compile. I am guessing I'm missing a library somewhere. I'll appreciate any help I can get on this.
Starting from first error message:
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
Line 41 of core.c is:
static const luaL_reg ifcorelib[] = {
Cryptic message from gcc means that it knows nothing about what is the luaL_reg and it thinks that it is variable name. Then it goes into panic when reads second variable name in the same definition/declaration. luaL_reg should be something like struct.
So, it seems that your problems are located in LUA development headers. May be you have too old or even to modern Lua package.
The imapfilter's github's readme says:
Compile time requirements are Lua (version 5.1)
Are you sure that your lua is 5.1 and the lua-devel (or any other package with lua headers) is 5.1 too?