rbenv install not downloading ruby version - ruby-on-rails-4

Installing ruby version with rbenv rbenv install -lreturns the proper list. However
$ rbenv install 2.3.4 -v
fails on the download, even though it can be downloaded via a browser. My hunch about an improper version of openssl (due to some distant memory of having such issues - tls version? - in the past) is supported in verbose mode:
ruby-build: use openssl from homebrew
/var/folders/kV/kVDOSPkcEuqSVnTjenAVRE+++TI/-Tmp-/ruby-build.20170601122915.1010 ~ Downloading ruby-2.3.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.4.tar.bz2
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
error: failed to download ruby-2.3.4.tar.bz2
how to overcome? can I point rbenv to use the downloaded tarball?

The reason is because rbenv use old system curl and old system openssl with it, which knows nothing about protocols TLS v 1.1-1.3. For me, installing new version of curl and openssl with brew did the work:
brew install openssl#1.1
brew install curl
Then add installed curl to your PATH (before default path, which is /usr/bin), and ensure that openssl of actual brew's version is also there (add this to your ./bash_profile or ./zshrc or etc):
export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"
export PATH="/usr/local/opt/curl/bin:$PATH"
You can make sure after relaunch of terminal that latest versions of this programs will be used by trying
which -a openssl
which -a curl
openssl version -a
curl -V
First two commands should output all paths with the programs, but top ones should be brew versions. Last two commands should show latest versions of programs (1.1.0f and 7.55 for me now).
Now try
rbenv install [version]
Works on MacOS Sierra with enabled SIP.

Related

What is the proper way to install bubblewrap for opam (ideally without admin priviledges)?

I am getting this error:
(iit_synthesis) brando9~ $ bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"
## Using already downloaded "/tmp/user/22003/opam-2.1.4-x86_64-linux"
## Where should it be installed ? [/lfs/ampere4/0/brando9/.local/bin] ~/.local/bin
## '~/.local/bin' resolves to '/lfs/ampere4/0/brando9/.local/bin', do you confirm [Y/n] Y
## opam 2.1.4 installed to /lfs/ampere4/0/brando9/.local/bin
## Converting the opam root format & updating
No configuration file found, using built-in defaults.
Checking for available remotes: rsync and local, git.
- you won't be able to use mercurial repositories unless you install the hg command on your system.
- you won't be able to use darcs repositories unless you install the darcs command on your system.
[WARNING] Missing dependencies -- the following commands are required for opam to operate:
- bwrap: Sandboxing tool bwrap was not found. You should install 'bubblewrap'. See https://opam.ocaml.org/doc/FAQ.html#Why-does-opam-require-bwrap.
[ERROR] Sandboxing is not working on your platform ubuntu:
"~/.opam/opam-init/hooks/sandbox.sh build sh -c echo SUCCESS >$TMPDIR/opam-sandbox-check-out && cat $TMPDIR/opam-sandbox-check-out; rm -f
$TMPDIR/opam-sandbox-check-out" exited with code 10
Do you want to disable it? Note that this will result in less secure package builds, so please ensure that you have some other isolation mechanisms in
place (such as running within a container or virtual machine). [y/N]
but it doesn't link to a way to actually install it, link given https://opam.ocaml.org/doc/FAQ.html#Why-does-opam-require-bwrap and also I thought this would mean I don't need to do that:
opam init --disable-sandboxing
opam update --all
eval $(opam env)
am I wrong? I'm confused.
To install bubblewrap on Ubuntu 18.04 or later just do
sudo apt-get install bubblewrap
If you have an older Ubuntu distribution or a distribution that doesn't package this program, then follow the instructions on the bubblewrap page to install it.
Of course, you can opt out of using bubblewrap, this is actually what the message is telling you. Just say, y for yes and it will continue without bubble-wrapping anything. For example, if you're building in a docker container, you don't need an extra layer of containerization that is provided by bubblewrap so you can drop it off.
also I thought this would mean I don't need to do that:
opam init --disable-sandboxing
...
Yes, once you install opam the binary, and if you opted out of using bubblewrap you need to initialize opam with this option (opam installation roughly consists of two steps, first you download and install the binary, next you need to run opam init so that it configures itself in your system).

Magento on PHP 7.2 wamp server

i am configuring an existing magento project on local system with WAMP server php version 7.2, while installing magento i get error "PHP extension "mcrypt" must be loaded."
Problem is mycrypt is no longer supported in php 7.2, can anyone suggest how can i resolve it?
mcrypt has been moved from php to pecl since 7.2
You still can install it.
Install dependencies
gcc make autoconf libc-dev pkg-config
install the lib itself
libmcrypt-dev
I assume php7.2 and pecl are installed so you just install mcrypt-1.0.1 (or whatever version is in rep.) with pecl
pecl install mcrypt-1.0.1

Can't call Stripe on Appengine development server even with latest ssl

I am running into the same issue on my development server. I have already checked out stackoverflow.com/questions/46799365/… and that hasn't worked for me.
python -V
Python 2.7.11
and as soon as I call stripe, I get the Support for test mode requests made with versions of TLS lower than 1.2 has been disabled, and support in live mode will be dropped on June 13, 2018. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.
My app.yaml has ssl set to "latest" libraries: - name: django version: "1.9" - name: jinja2 version: "2.6" - name: markupsafe version: "0.15" - name: ssl version: latest - name: pycrypto version: latest
So am I supposed to do something with sandbox.py? I think my request is version 2.16.0 because I was getting some other environment issue when it wasn't. Is that he culprit or something else?
Here's the exact error
PermissionError at /
Request req_DrUOViv9FnjhAx: Support for test mode requests made with versions
of TLS lower than 1.2 has been disabled, and support in live mode will be dropped on June 13, 2018. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.
Request Method:
GET
Request URL:
http://localhost:8080/
Django Version:
1.9.5
Exception Type:
PermissionError
Exception Value:
Request req_DrUOViv9FnjhAx: Support for test mode requests made with versions of TLS lower than 1.2 has been disabled, and support in live mode will be dropped on June 13, 2018. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.
Exception Location:
lib/stripe/api_requestor.py in handle_error_response, line 178
Python Executable:
/Users/USERNAME/PycharmProjects/PROJECTNAME/virtualenv-dev/bin/python
Python Version:
2.7.11
Python Path:
['/Users/USERNAME/PycharmProjects/PROJECTNAME',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine',
'/Users/USERNAME/PycharmProjects/PROJECTNAME',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine',
'/Users/USERNAME/PycharmProjects/PROJECTNAME/virtualenv/lib/python2.7',
'/Users/USERNAME/PycharmProjects/PROJECTNAME/virtualenv/lib/python2.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/django-1.9',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/jinja2-2.6',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/markupsafe-0.15',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/ssl-2.7.11',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/pycrypto-2.6',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/setuptools-0.6c11',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/protorpc-1.0',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/pytz-2017.2',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.3',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/webob-1.1.1',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/werkzeug-0.11.10',
'/Users/USERNAME/Downloads/google-cloud-sdk/platform/google_appengine/lib/yaml-3.10',
'lib']
Server time:
Sat, 24 Mar 2018 00:43:28 -0500
I spent many hours on this about a month ago. It was a huge pain, but I finally got it to work.
One issue I was having is that Brew does something very annoying with its python versions. It makes python v3 the default so if you type python in the shell you get v3 and not v2. I manually changed the relevant symlinks in '/usr/local/bin' to make v2 the default.
I don't remember all the steps I took, but you'll want your '/usr/local/bin' to look something like this:
openssl -> /usr/local/Cellar/openssl/1.0.2n/bin/openssl
pip -> ../Cellar/python/2.7.14_3/bin/pip2
python -> ../Cellar/python/2.7.14_3/bin/python2
You'll then want to delete your virtualenv's and recreate them.
Note that I don't use python v3 at all, so if you need both v2 and v3 then YMMV.
In addition to using the latest GAE ssl library, when running the application on the local development server you may also need to upgrade your local system's openssl library.
From How do I upgrade my Stripe integration from TLS 1.0 to TLS 1.2? (other specific OS versions are mentioned separately):
If you are using any other system, or are already using brew on OS X, you will need to upgrade your OpenSSL version.
And from How do I upgrade my OpenSSL to support TLS 1.2? (other specific OS versions are mentioned separately):
If you are using any other Linux variant, you will need to ensure that
running openssl version gives a version of at least 1.0.1. If it
does not, you will need to take package updates, and may need to
upgrade to a newer version of your operating system.
Hope this helps someone in this situation....I had my IT admin help me and and it was a combination of things so I'm posting the solution here for my case to save someone else from the same frustration.
These instructions assume you are running these commands all as an Administrator
First remove HomeBrew:
echo -ne 'y\n' | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
sudo rm -rf /usr/local/Homebrew
sudo rm -rf /usr/local/Caskroom
sudo rm -rf /usr/local/Cellar
Remove other Pythons installed (v2)
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7"
Check for links and remove any you find with Cellar in the path
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | grep 'Cellar'
unlink <## Remove those you found ##>
Re-install Homebrew
echo -ne 'y\n' | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Add in openssl
brew install openssl
brew postinstall openssl
brew link openssl --force
Force Link openssl if needed
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
Add in Python
brew install python#2
brew postinstall python#2
brew link python#2 --force
link openssl and Python (ensure these versions are what you have installed)
ln -s /usr/local/Cellar/openssl/1.0.2o/bin/openssl /usr/local/bin/openssl
ln -s /usr/local/Cellar/openssl/1.0.2o/bin/openssl /usr/local/ssl/bin/openssl
ln -s /usr/local/Cellar/python/2.7.14/bin/python /usr/local/bin/python
Clean HomeBrew Once Installed
brew cleanup -s
brew cask cleanup
brew prune
From here the command showed the correct version
python -c 'import ssl; print ssl.OPENSSL_VERSION'

AWS Linux Server install R package

I try to install the package "data.table" (and "aws.s3)" via Rstudio Server on an Amazon Linux instance following this guide:
http://stanke.co/category/r/
Unfortunately, I get the following error message. I really don't know what else to do.
Can anybody help? I installed devtools and I am able to install other packages such as xml2, devtools and deplyr.
I had the same issue on AWS and already fixed.
You need first install gcc64 and openmp shared support library.
sudo yum install gcc64
sudo yum install libgomp
Then under your user home create an .R folder with a Makevars file in it, with the following content (it will tell to R which compiler to use):
CC = /usr/bin/gcc64
CXX = /usr/bin/g++
SHLIB_OPENMP_CFLAGS = -fopenmp
I hope it's working for you as well ...
You need to install dmlc-core.
This link will provide more information:
A common bricks library for building scalable and portable distributed machine learning
based on https://github.com/RcppCore/RcppArmadillo/issues/200, I think this issue is due to a g++ compatability issue. It might also explain why when I installed devtools it kept giving me [-Wdeprecated-declarations]
so run:
sudo yum remove gcc72-c++.x86_64 libgcc72.x86_64
yum install R-devel
Then you should be able to run the installation command.

Cross compile on Fedora 18 for Centos 6.4

I am working on a Project, which uses classes from the C++11 standard, on a Fedora 18 machine and want to deploy it on a Centos 6.4 server.
I was able to resolve all loader errors except for the libc and libc++ versions, which are GLIBC_2.11, GLIBCXX_3.4.15 and on my Fedora machine GLIBC_2.14 and at least GLIBCXX_3.4.17 respectively.
Is it possible to tell the compiler to compile/link for the server versions or older compatible versions of the libraries?
When i run ldd executable i get
./executable: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./executable)
./executable: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./executable)
Thanks in advance!
Instead of manually copying libraries to a separate directory you could set up a chroot contaiing the CentOS build env, using mock and the epel-6-x86_64 config.
Use yum in the mock chroot to install the packages you want (e.g. Qt) and build in there, that will ensure the code only uses the CentOS 6 libs that are installed in the chroot, not the rest of the packages on your Fedora OS.
Update:
When I'm using a mock chroot for building GCC I do this:
# only need these steps once to setup the chroot
mock -r fedora-19-x86_64 --init
mock -r fedora-19-x86_64 --install yum
mock -r fedora-19-x86_64 --shell 'mkdir -p /builddir/gcc/src /builddir/gcc/build'
su -c 'mount --bind $PATH_TO_GCC_SOURCES /var/lib/mock/fedora-19-x86_64/root/builddir/gcc/src'
# enter root password
mock -r fedora-19-x86_64 --shell
# now in chroot
yum install gmp-devel mpfr-devel libmpc-devel flex autogen
su - mockbuild
cd gcc/build
../src/configure --prefix=/builddir/gcc/install ... etc. ...
For your purpose you'd replace fedora-19 with epel-6
The bind mount means I don't need to have the GCC sources in the chroot, I can use the existing copy in my normal filesystem. See http://gcc.gnu.org/wiki/InstallingGCC for info on building GCC
Once you install GCC in the chroot you can use it to build your own programs then package them up for CentOS.
To go back into the chroot again later:
mock -r fedora-19-x86_64 --shell
su - mockbuild