Luarocks openssl - lua

I am trying to install luajwt using the following command:
$ sudo luarocks install --server=http://rocks.moonscript.org luajwt
But unfortunately, I receive the following error:
Installing http://rocks.moonscript.org/luajwt-1.3-4.src.rock
Missing dependencies for luajwt 1.3-4:
luacrypto >= 0.3.2-1 (not installed)
lua-cjson >= 2.1.0 (not installed)
lbase64 >= 20120807-3 (not installed)
luajwt 1.3-4 depends on lua >= 5.1 (5.4-1 provided by VM)
luajwt 1.3-4 depends on luacrypto >= 0.3.2-1 (not installed)
Installing http://rocks.moonscript.org/luacrypto-0.3.2-2.src.rock
Error: Failed installing dependency: http://rocks.moonscript.org/luacrypto-0.3.2-2.src.rock - Could not find header file for OPENSSL
No file openssl/evp.h in /usr/local/include
No file openssl/evp.h in /usr/include
No file openssl/evp.h in /include
No file openssl/evp.h in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
No file openssl/evp.h in /usr/local/opt/include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.
Example: luarocks install luacrypto OPENSSL_DIR=/usr/local
I tried to resolve that issue by installing OpenSSL with luarocks but I am getting the same error:
➜ Luarocks install openssl
Installing https://luarocks.org/openssl-0.8.2-1.src.rock
Error: Could not find header file for OPENSSL
No file openssl/evp.h in /usr/local/include
No file openssl/evp.h in /usr/include
No file openssl/evp.h in /include
No file openssl/evp.h in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
No file openssl/evp.h in /usr/local/opt/include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.
Example: luarocks install openssl OPENSSL_DIR=/usr/local
How can I avoid this error?

Related

Can't install http module with luarocks on Ubuntu

HTTP module installation is failing on Ubuntu with following error:
root#someserver:/var/log# luarocks install http
Warning: falling back to wget - install luasec to get native HTTPS support
Installing https://luarocks.org/http-0.4-0.all.rock
Missing dependencies for http 0.4-0:
cqueues >= 20161214 (not installed)
luaossl >= 20161208 (not installed)
basexx >= 0.2.0 (not installed)
binaryheap >= 0.3 (not installed)
fifo (not installed)
http 0.4-0 depends on cqueues >= 20161214 (not installed)
Installing https://luarocks.org/cqueues-20200726.51-0.src.rock
Error: Failed installing dependency: https://luarocks.org/cqueues-20200726.51-0.src.rock - Could not find header file for CRYPTO
No file openssl/crypto.h in /usr/local/include
No file openssl/crypto.h in /usr/include
You may have to install CRYPTO in your system and/or pass CRYPTO_DIR or CRYPTO_INCDIR to the luarocks command.
Example: luarocks install cqueues CRYPTO_DIR=/usr/local
Any tips?
Seems OpenSSL isn't installed in your system. So try running:
sudo apt-get install libssl-dev

Kong-OIDC Plugin Installation Issue

I am installing Kong-OIDC plugin in a Kong docker container and get following error:
Error: Failed installing dependency: https://luarocks.org/lua-resty-openidc-1.6.0-1.src.rock - Failed installing dependency: https://luarocks.org/lua-resty-jwt-0.2.2-0.src.rock - Rockspec format 3.0 is not supported, please upgrade LuaRocks.
Seems like one of the underlying dependency "lua-jesty-jwt" is using Rockpsec format 3.0 version, which is not supported any more. Is there a way to get around this issue ?
I updated the Dockerfile with a previous version of the kong-oidc plugin. The Dockerfile looks like this:
FROM kong:0.14-centos
LABEL description="Centos 7 + Kong 0.14 + kong-oidc plugin"
RUN yum install -y git unzip && yum clean all
RUN luarocks install kong-oidc 1.0.1
But running docker build -t kong:0.14-centos-oidc returns this error:
Error: Failed installing dependency: https://luarocks.org/lua-resty-openidc-1.2.3-1.src.rock - Failed installing dependency: https://luarocks.org/lua-resty-hmac-v1.0-1.rockspec - Failed installing dependency: https://luarocks.org/luacrypto-0.3.2-2.src.rock - Could not find header file for OPENSSL
No file openssl/evp.h in /usr/local/include
No file openssl/evp.h in /usr/include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.
Example: luarocks install luacrypto OPENSSL_DIR=/usr/local
So we need to add RUN yum install openssl-devel -y to the Dockerfile. So, if you run again the docker build command, you'll get this error:
Build error: Failed compiling object src/lcrypto.oError: Failed installing dependency: https://luarocks.org/lua-resty-openidc-1.2.3-1.src.rock - Failed installing dependency: https://luarocks.org/lua-resty-hmac-v1.0-1.rockspec - Failed installing dependency: https://luarocks.org/luacrypto-0.3.2-2.src.rock - Build error: Failed compiling object src/lcrypto.o
So we need to install the gcc compiler adding RUN yum install -y gcc to the Dockerfile. The final result is:
FROM kong:0.14-centos
LABEL description="Centos 7 + Kong 0.14 + kong-oidc plugin"
RUN yum install -y git unzip && yum clean all
RUN yum install -y openssl-devel -y
RUN yum install -y gcc
RUN luarocks install kong-oidc 1.0.1
Now the container builds successfully, but I think the current kong-oidc plugin is not maintained anymore.
UPDATE: Check this repository to get a working example of the kong-oidc plugin with Keycloak.
The latest version of kong-oidc (1.1.0) did not work for me, but I was able to install an older version (1.0.1) without much issue. I did have to install an additional library "openssl-devel" (yum install openssl-devel).

Can't upgrade from erlang-R14B-04 to erlang-R16B-03

I want to install the latest RabbitMQ server 3.6.14 on CentOS 6.
I followed this tutorial: How To Install and Manage RabbitMQ
When I ran the below command to install "erlang", it installed the "erlang-R14B-04" package and not "erlang >= R16B-03" required to install RabbitMQ 3.6.14.
# yum install erlang
So I tried to uninstall erlang by running
# yum remove erlang
And when I downloaded and tried to install "erlang >= R16B-03" from a .rpm file, I encountered the following errors:
Transaction Check Error:
file /usr/bin/epmd from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-erts-R14B-04.3.el6.x86_64
file /usr/bin/erl from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-erts-R14B-04.3.el6.x86_64
file /usr/bin/erlc from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-erts-R14B-04.3.el6.x86_64
file /usr/bin/escript from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-erts-R14B-04.3.el6.x86_64
file /usr/bin/run_erl from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-erts-R14B-04.3.el6.x86_64
file /usr/bin/run_test from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-erts-R14B-04.3.el6.x86_64
file /usr/bin/to_erl from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-erts-R14B-04.3.el6.x86_64
file /usr/bin/dialyzer from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-dialyzer-R14B-04.3.el6.x86_64
file /usr/bin/typer from install of esl-erlang-R16B03-1.x86_64 conflicts with file from package erlang-typer-R14B-04.3.el6.x86_64
Error Summary
To deal with them, I removed the mentioned files: epmd, erl, erlc, escript, run_erl, run_test, to_erl, dialyzer, and typer after backing them up.
But still I face the same error. How do I upgrade from erlang-R14B-04 to erlang-R16B-03? Please help.
Download the package:
wget https://github.com/rabbitmq/erlang-rpm/releases/download/v20.3.0/erlang-20.3-1.el6.x86_64.rpm
then install
yum install erlang-20.3-1.el6.x86_64.rpm

Ruby nokogiri LoadError: How to change library search path?

When I executed a ruby script, I got the following error. The script uses 'nokogiri'. It seems to search 'libxml2.2.dylib' from '/Users/XXX/.bundler/tmp/...' but the library is actually in '/usr/local/Cellar/libxml2/2.9.0/lib/libxml2.2.dylib'.
The searched directory (/Users/XXX/.bundler/tmp/10029/) does not exist.
ruby test.rb
/Users/XXX/.rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': dlopen(/Users/XXX/.rvm/gems/ruby-1.9.3-p392
/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle, 9): Library not loaded: /Users/XXX/.bundler/tmp/10029/gems/nokogiri-1.6.0/ports/i686-apple-d
arwin11/libxml2/2.8.0/lib/libxml2.2.dylib (LoadError)
Referenced from: /Users/XXX/.rvm/gems/ruby-1.9.3-p392/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle
Reason: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0 - /Users/yus
aku/.rvm/gems/ruby-1.9.3-p392/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle
How can I change the library search path?
I followed the official installation of 'Nokogiri' (home-brew 0.9)
http://nokogiri.org/tutorials/installing_nokogiri.html
brew install libxml2 libxslt
brew link libxml2 libxslt
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
tar xvfz libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
make
sudo make install
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.0/include/libxml2/
--with-xml2-lib=/usr/local/Cellar/libxml2/2.9.0/lib
--with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28
--with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include
--with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
Any suggestion or at least direction will be appreciated.

How do I uninstall openssl in /usr/lib?

After installing the pg gem, I'm getting this error when I try to start the server on my local machine:
/Users/foo/.rvm/gems/ree-1.8.7-2011.12/gems/pg-0.14.0/lib/pg_ext.bundle: dlopen(/Users/foo/.rvm/gems/ree-1.8.7-2011.12/gems/pg-0.14.0/lib/pg_ext.bundle, 9): Library not loaded: #loader_path/../lib/libssl.dylib (LoadError)
Referenced from: /usr/lib/libpq.5.dylib
Reason: Incompatible library version: libpq.5.dylib requires version 1.0.0 or later, but libssl.dylib provides version 0.9.8 - /Users/foo/.rvm/gems/ree-1.8.7-2011.12/gems/pg-0.14.0/lib/pg_ext.bundle
I have an up to date version of openssl installed on my machine via macports but it seems like the gem is looking at the older version that I have installed in /usr/lib for some reason (maybe something to do with a messed up #loader_path?).
'openssl version' gives me 'OpenSSL 1.0.1c 10 May 2012'
and 'which openssl' gives me '/opt/local/bin/openssl' as I expected
Any help is really appreciated. Thanks!
I just ran into this problem after updating to Mountain Lion. After checking that I had a proper OpenSSL version, I did the following.
$ ls /Library/PostgreSQL/9.1/lib/libssl*
Provided the following:
/Library/PostgreSQL/9.1/lib/libssl.1.0.0.dylib
/Library/PostgreSQL/9.1/lib/libssl.dylib
/Library/PostgreSQL/9.1/lib/libssl.a
I copied the file as so:
$ sudo cp /Library/PostgreSQL/9.1/lib/libssl.1.0.0.dylib /usr/lib/
Then linked:
$ cd /usr/lib
$ ln -sf libssl.1.0.0.dylib libssl.dylib
After that, I tried rails s again and the same error came up with a different file, so I repeated the process (libcrypto):
requires version 1.0.0 or later, but libcrypto.0.9.8.dylib
provides version 0.9.8
so:
$ sudo cp /Library/PostgreSQL/9.1/lib/libcrypto.1.0.0.dylib /usr/lib/
$ cd /usr/lib
$ ln -sf libcrypto.1.0.0.dylib libcrypto.dylib
See this question's answers for reference as well:
python pip install psycopg2 install error

Resources