Rvm error: Error running '__rvm_make -j2' - ruby

Error running '__rvm_make -j2',
please read /usr/share/rvm/log/1657548775_ruby-2.5.5/make.log
There has been an error while running make. Halting the installation.

After struggling a lot. This worked for me
rvm pkg install openssl
rvm remove x.x.x
rvm install x.x.x -C --with-openssl-dir=$HOME/.rvm/usr

Foreword: I encountered this problem while trying to install rvm in WSL2
Onto to the meat now.
You may encounter newer versions of this error marked by a different end switch. I mean, instead of the last switch being strictly -j2, yours might be -j3, j4, j5, or other subsequent ones. Therefore proceed to read below for a possible solution.
Shortly, I suggest two commands to resolve this error. Please do not run the installation suggestion that may appear immediately after running the first command. Instead, just proceed to run the second command.
On pasting the second command, replace <version> portion with the appropriate ruby version you would like to install. In my case, I wanted to install ruby version 2.7.4, and therefore, I set it as ruby-2.7.4
rvm pkg install openssl
rvm install ruby-<version> --with-openssl-dir=/usr/share/rvm/usr
However, if the above fix fails to remedy the ruby installation problem, you can ensure that rvm is added to the user group by running the command below:
rvm group add rvm $USER
After running the command above, close the Ubuntu app and reopen it. Then proceed to run the command below:
rvm fix-permissions
Now try reinstalling ruby with the command rvm install 2.7.4 --default. If problems persist, run sudo usermod -a -G rvm $USER and attempt a reinstall. If that fails, only further research gives you a chance.
PS:
Please note that I was making this installation in Windows Subsystem for Linux (WSL2) Ubuntu Therefore, if this problem persists in another system like macOS, it may mean that this solution is perhaps not platform agnostic, and thus, the specific solution for such requires further digging.

I ran into a similar problem - Error running "__rvm_make -j4". The bug was the lack of support for OpenSSL 3.0 when used on Ubuntu 22.04. You can try using "rbenv" instead of "rvm", it worked for me.

Had a similar error "Error running '__rvm_make -j10'" and solved with --with-out-ext=fiddle flag.
rvm install "ruby-2.7.0" --with-out-ext=fiddle
This on M1

you can try this command to solve the issue
sudo apt-get install curl git g++ make libssl-dev libreadline-dev zlib1g-dev

Related

cannot install ruby using rvm as an unprivileged user with no sudo privileges

According to the rvm documentation at
https://rvm.io/rvm/install
it should be possible to install rvm, and subsequently a ruby, as a non-privileged user.
Under troubleshooting at
https://rvm.io/support/troubleshooting
it states:
Any user in the rvm group can update RVM, rubies, and gemsets. There
is never a reason to use sudo post-install.
rvm installs fine as a non-privileged user (There is no rvm group):
nosudo-user#my-site.com:~$ bash ~/downloads/rvm_installer.sh stable
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
...
Installing RVM to /<user-home>/.rvm/
...
However, when I try to install a ruby version, it fails (I think) trying to do an apt-get because it needs sudo privileges:
nosudo-user#my-site.com:~$ rvm install 2.6.6
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.6.tar.bz2
...
Updating system... password required for 'apt-get --quiet --yes update':
.
Error running 'requirements_debian_update_system ruby-2.6.6',
please read /<user-home>/.rvm/log/1659735568_ruby-2.6.6/update_system.log
Requirements installation failed with status: 1.
From the log:
2022-08-05 21:39:28] requirements_debian_update_system
requirements_debian_update_system ()
{
__rvm_try_sudo apt-get --quiet --yes update || {
\typeset __ret=$?;
case ${__ret} in
100)
rvm_error "There has been an error while updating your system using \`apt-get\`.
It seems that there are some 404 Not Found errors for repositories listed in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
apt-get update (as a user with sudo privileges) shows no errors.
How is one supposed to install rvm so a non-privileged user can install a version of ruby?
My guess is your system is missing some basic system libraries for buiding Ruby from source. Hence RVM tries to fetch the build libraries for you. This will be a one-time update, and after your system has the proper libraries installed, RVM will not require sudo again.
However if you want you can disable apt updating completely with:
rvm autolibs disable
Note that if you have missing build requirements, then the build step of Ruby will quite likely fail. Only way to find out is to try.
In that case you can use the requirements command to help you install missing dependencies:
rvm requirements
Casper's answer above provided the missing information; there were some missing libraries. However, the steps required to be able to install as an unprivileged user were rather un-intuitive (to me, at least):
Install rvm using sudo; in that process it creates the "rvm" group.
Add the desired users to the rvm group
Note:
Attempting to install a ruby as an unprivileged user after this step still fails.
sudo to root to get the rvm magic paths installed for root, then start installing a ruby, but kill the process after the requirements installation is complete.
Log in as the desired unprivileged user and use rvm to install the desired ruby for that user.
Cmds:
sudo rvm_installer.sh stable
sudo usermod -a -G rvm the-user
sudo -i
rvm install 2.6.6
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.6.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..
Installing required packages: g++, gcc, autoconf, automake, bison, libffi-dev, libgdbm-dev, libncurses5-dev, libsqlite3-dev, libtool, libyaml-dev, make, pkg-config, sqlite3, libgmp-dev, libreadline-dev......................|
Requirements installation successful.
^C
exit
sudo -i -u the-user
rvm install 2.6.6

Error while installing ruby using rvm

Am getting the below error while trying to install ruby using rvm:
$rvm install 1.9.3
Searching for binary rubies, this might take some time.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..................................................................................................
Error running 'requirements_debian_update_system ruby-1.9.3-p448',
please read /home/troy/.rvm/log/1379872584_ruby-1.9.3-p448/update_system.log
Requirements installation failed with status: 100.
Can you help me on this!
Remove broken or 404 repos from your /etc/apt/sources.list.
rvm will fail if you don't remove or comment them out.
To work out which aren't working, run apt-get update and see which ones are marked as failing.
Once you are using rvm, installing Ruby is easy.
rvm install ruby
rvm use ruby --default
I had the same problem.
It isn't unusual to not have a binary package for you distribution, and rvm should try to install from source.
First, check that it didn't actually install it:
rvm list
Otherwise, I suspect you may be missing some depedencies, which you can find with:
rvm requirements
You'll need to install those and the run the install again.
make sure you can update your system:
sudo apt-get update
and then start rvm installation again.
Update 1:
also it looks like you are using old version of rvm, make sure to update rvm before continuing:
rvm get stable
been having a similar problem and discovered a typo in grizzly.list file
http://ubuntu-cloud.archive.cononical.com precise-updates/grizzly
should have been
http://ubuntu-cloud.archive.canonical.com precise-updates/grizzly
i.e. first a in canonical
is this mistake part of the ubuntu 12.04 distribution?
Make sure when you run sudo apt-get update, all your PPAs are updating correctly. If not, remove them or edit them so they do so (you might need to change the distribution, for example, from raring to lucid. You can do this through terminal or Software Center. This and this should help)
When you are initially installing rvm, read the notes. For suppose you get notes like,
create a * WARNING: You have '~/.profile' file, you might want to load it,
to do that add the following line to '/home/name/.bash_profile':source ~/.profile
Then-> $ sudo gedit /home/name/.bash_profile
Add line `~/.profile` to the file. Save and close it.
now run $ rvm requirements
You should get a success message.
RVM will not install ruby if apt-get is failing. I had the same issue and noticed when running apt-get update, it was failing on "google-chrome.list". I fixed it following these directions and was then able to successfully run apt-get update, which then allowed me to run rvm install ruby.
Edit google-chrome.list (assuming you’re on the Stable Channel):
sudo gedit /etc/apt/sources.list.d/google-chrome.list
In the text file that opens edit the file so that the line reads:
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
Try to update again:
sudo apt-get update
Try to run RVM again:
rvm install ruby
this problem caused in apt-get update so you have to disable the PPA :
System Settings>Software & Updates>Other Software
then reinstall.
this image show disable PPA
I was facing the same problem and just did that:
sudo rm /etc/apt/sources.list.d/webupd8team-ubuntu-sublime-text-3-bionic.list
Now it works!
I faced the same problem while executing the command
curl -L https://get.rvm.io | bash -s stable --autolibs=3 --rails
It appeared to be that I was using the command as not a previleged user. So, using
sudo curl -L https://get.rvm.io | bash -s stable --autolibs=3 --rails
solved the problem
Below solution is to solve the rvm requirment error returns 100
If any deb command is commented in /etc/apt/sources.list than try to uncomment that command from /etc/apt/sources.list
Command is:
$sudo vi /etc/apt/sources.list
If problem is not solved than replace sources.list file with other Ubuntu's sources.list
Command is:
$mv /etc/apt/sources.list
Please make a backup before doing that
Command is:
$cp /etc/apt/sources.list sources_backup.list
Problem should solve by this time, if not than reinstall the Ubuntu.
Note: If sources.list file is corrupted than it will gives problem to install other packages.
I had a permission problem, solved with:
sudo chmod 777 log
I had the above error on installing ruby-2.3.0 in Ubuntu 16.04.
Go to the file:
/etc/apt/sources.list.d/mc3man-ubuntu-trusty-media-xenial.list
and remove the below:
deb-src http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
then run sudo apt-get update and after rvm install ruby-2.3.0 it's working.
you can temporarily disable updates by this
sudo apt-get update | grep "Failed"
Ruby RVM apt-get update error

Unable to get ruby running on Mac OSX 10.8.3

I have been trying to get Ruby to run on my Mac for a few days and whatever I do does not seem to be successful. I have installed MacPorts and followed the post here: Installing Ruby on Mac OS X 10.8.2
I ran the following commands:
sudo port selfupdate
sudo port install apple-gcc42
They completed sucessfully then I ran the line below:
CC=/opt/local/bin/gcc-apple-4.2 rvm install ruby-1.9.3-p194 --enable-shared --without-tk --without-tcl
After I run that line it takes a couple minutes and I get the following:
enter code here MacPorts base is already the latest version
DEBUG: Setting MacPorts sources ownership to root
The ports tree has been updated. To upgrade your installed ports, you should run
port upgrade outdated
i686-apple-darwin12-gcc-apple-4.2.1: no input files
Missing required packages: autoconf, automake, libtool, pkgconfig, libiconv, libyaml, readline, libxml2, libxslt, libksba, openssl, curl-ca-bundle, sqlite3, zlib, ncurses, gdbm.
Cowardly refusing to continue, please read 'rvm autolibs'.
There were package installation errors, make sure to read the log.
Do I need to install the missing packages that it references? If so, how do I do this? I'm not very familiar with MacPorts and would appreciate the help to get this working.
Since I originally I went to install RVM through https://rvm.io/rvm/install/ I followed the first command to RVM with ruby:
$ \curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby
After I ran the command it downloaded and compiled then when it went to install rubygems-2.0.3 for ruby-2.0.0-p0 it gave the following error message:
Error running 'env GEM_PATH=/usr/local/rvm/gems/ruby-2.0.0-p0:/usr/local/rvm/gems/ruby-2.0.0-p0#global:/usr/local/rvm/gems/ruby-2.0.0-p0:/usr/local/rvm/gems/ruby-2.0.0-p0#global GEM_HOME=/usr/local/rvm/gems/ruby-2.0.0-p0 /usr/local/rvm/rubies/ruby-2.0.0-p0/bin/ruby -d /usr/local/rvm/src/rubygems-2.0.3/setup.rb --verbose',
please read /usr/local/rvm/log/ruby-2.0.0-p0/rubygems.install.log
I then went to open the log file and at the bottom it says
ERROR: While executing gem ... (NoMethodError) undefined method fu_stream_blksize for #<Gem::Commands::SetupCommand:0x007fa09b05d7a8>
Installing RubyGems
Installing gem executable
Any ideas what I can do next?
Thanks in advance.
I had similar problems with OS X 10.8.3 and XCode 4.6.1. After some googling, I tried the install with a similar RVM command, except using the XCode version of clang (which symlinks to /usr/bin/cc). Try this:
\curl -#L https://get.rvm.io | bash -s stable #just get rvm
source ~/.rvm/scripts/rvm
rvm get head # update to latest rvm
CC=/usr/bin/cc rvm install ruby
It should have the same failure installing rubygems-2.0.3, but reinstalling just rubygems should work:
CC=/usr/bin/cc rvm install rubygems latest # substitute "2.0.3" for "latest" if you like.
It appears that this is a bug in rubygems which is scheduled for fixing in 2.0.4.
Hope that helps!
I think this bug provide from FileUtils.
To fix it you need change rubygems script from rvm: nano .rvm/scripts/rubygems
To find words in nano use ctrl+w setup.rb and remove --verbose option.
After this you need ctrl+o to save file and ctrl+x to close nano.
Now you may reinstall rubygems:
rvm rubygems remove
rvm rubygems latest
Sorry for my bad english.
Hope this help you.
In addition to Valery's answer, you might have to do the following before removing and reinstalling:
echo ${LANG:-empty}
export LANG=en_US.utf-8
Links to the problem and solution:
https://github.com/rubygems/rubygems/issues/516
https://github.com/wayneeseguin/rvm/issues/1689
This problem is harmless, rubygems is already installed and will work as expected, this is triggered by https://bugs.ruby-lang.org/issues/7992 - with --verbose flag to rubygems installation - your ruby is fully usable if there was no other error during installation.
A side note, RVM detects all the options/flags you have passed and it is not required to pass them manually, it would be enough to run:
rvm install ruby-1.9.3-p194
The RVM installer ran with --autolibs=3 is equivalent to running it withoug and setting it manually with:
rvm autolibs 3
To get more information on autolibs and available modes run:
rvm help autolibs

Error Installing Jekyll - Native Extension Build

I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link. I think it's an update to Ruby, but RVM is having trouble installing alternate versions of ruby as well.
Heres the full post:
$ sudo gem install jekyll
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out
Does this mean I need to update the version of ruby I'm using via rvm?
Ubuntu
sudo apt-get install ruby-dev
gem install jekyll
Your problem is that either you system doesn't know where make is located at or you don't have it installed. The easiest way to fix this (and probably other issues you'll run into trying to get a ruby system up and running) is to install xcode.
You can get it at http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 for lion. Or it came on a CD with your computer for earlier versions.
If you're using Lion, please see comments below for a link to how to install developer tools on Lion.
I had the same error on Ubuntu and this helped me sort it out.
You must have ruby-dev installed
apt-get install ruby-dev
If you installed XCode and command line tools are still missing go to Terminal and
xcode-select --install
it will prompt you to install these tools. After that just follow SrBlanco´s answer. That solved the problem for me.
Good luck.
Need to install "make".
I am using Ubuntu 12.10.
sudo apt-get install make
Should work on any Debian based distro.
Note: this problem also occurs on newer MacBook Pro models that come with Mavericks pre-installed. I updated another post with my own solution that didn't involve Xcode at all. My system had the Xcode developer tools installed when I got the machine.
ERROR: Error installing jekyll: ERROR: Failed to build gem native extension
Install Xcode as mentioned if you don't have it installed already (https://developer.apple.com/xcode/). Plus you need the command line tools.
Open Xcode. Go to Preferences > Downloads > Install Command Line Tools
Installing command line tools for Xcode solved the problem for me on my Mac
xcode-select --install.
sudo apt-get install ruby-dev
sudo gem install jekyll
hope this will help, it works with me.
I had this same exact error when trying to install Jekyll, and the following steps from this link helped me. Just in case anyone else comes across this!
http://davidensinger.com/2013/03/installing-jekyll/
I was facing the same issue in my Fedora 22 setup. I had ruby installed but didn't have ruby-devel. Installing ruby-devel fixed the issue for me.
dnf install -y ruby-devel
For older systems:
yum install -y ruby-devel
I followed this on Ubuntu/Linux Mint
sudo apt install build-essential
sudo apt install ruby-dev
sudo gem install jekyll
An addendum: You can install XCode now from the App Store on Mountain Lion. The process is transparent and pretty fast.
I had the same problems with you.
I use Mac OS X 10.9 develop preview version, and I had installed gcc and Xcode.
But my Xcode version is 4.6.
Then I install the Xcode 5.0
After that I type sudo gem install jekyll in the terminal again. Then it works.
Wish it could help someone.
Installing Xcode and going to perferencs > downloads > install commandline tools WORKS!
Same problem on Debian, I had forgot to run this command:
~/.rvm/scripts/rvm
All these answers did NOT work for me.
If you're looking for a solution on ubuntu 14.04, do this:
sudo apt-get install ruby1.9.1-dev zlib1g-dev nodejs
sudo gem install jekyll -v 2.5.3
Unfortunately, nodejs is required because of a bug in Jekyll that enforces existence of runtime JS engine even though it doesn't need one.
For Ubuntu, this helped in my case:
apt-get install libffi-dev
A general advice is to just follow what is displayed as the reason for the error and hopefully you'll be provided with a log file in which the first line suggests which package should be installed, in my case:
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/mkmf.log
MacOS
my solution to this problem
install xcode
type xcode-select --install in the command line
type sudo gem install jekyll in the command line
PS: It is the combination of the two answers in this question.
You are missing the ruby-dev file , just go ahead and run this command - sudo apt-get install ruby-dev
Hope this helps!!
I had the same issue on my macOS(10.14.2), the reason may be:
Apparently with OSX el Capitan, there is a new security function that prevents you from modifying system files called Rootless.
My solution is using rvm:
install ruby on Mac OS X with RVM
gem install jekyll
On windows I have this issue
I actually installed the version rubyinstaller-devkit-2.6.3-1-x64 of ruby
I have removed the ruby completely and Installed the rubyinstaller-devkit-2.5.5-1-x64
and issued the following commands on powershell
gem install bundler
gem install jekyll
and this time no errors where found
I had this issue and of all things, the error was occurring because I hadn't agreed to some updated terms of service in xcode. Running the following did the trick for me. Go figure.
sudo xcodebuild -license accept
For me, I had to upgrade homebrew and install rbenv to the latest ruby version. After that, I followed the instruction at jekyll website. My OS is Catalina 2019, I couldn't install Xcode, which is not compatible yet!
You have to set the path in your .bash_profile to make sure that it initializes the rbenv when you restart your terminal.
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
then
$ rbenv version
2.2.3 (set by /Users/mislav/.rbenv/version)
$ rbenv shell
rbenv: no shell-specific version configured
hope that help!
Here is the (only?) reliable and simple way to install Jekyll on macOS
Install UTM
Install Ubuntu Server
Install Jekyll using Ubuntu instructions at https://jekyllrb.com/docs/installation/ubuntu/
Forward port 22 in the VM settings (22->localhost->22)
Use VS Code on the macOS host
Install Remote SSH
Connect to USER#localhost
Drag and drop the folder on Mac into VS Code (this transfers files to remote)
Enable port forwarding for 4000 (bottom bar on VS Code)
Work on your website
Right click on your website on the file explorer and click download
If you have not done these steps, you might be delighted by:
Ubuntu imports your public SSH key from GitHub
VS Code magically handles file transfer in and out
VS Code magically installs your VS Code extensions onto the remote server and allows file search on the remote host

Installing Rubies in system wide RVM 1.5.2 install problem

Following this advice for installing RVM 1.5.2, I used these commands to install RVM 1.5.2 system wide (into /usr/local/rvm):
curl http://rvm.beginrescueend.com/releases/rvm-install-head > rvm-install-head
sudo bash rvm-install-head
That, in itself, worked. I added the appropriate source statements in my .bashrc file:
[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"
and proceeded to attempt to install Ruby 1.9.2 with this command:
sudo rvm install 1.9.2-head
However, I get "rvm: command not found". If I try it without sudo, I don't have appropriate permissions to create the necessary directories and so forth, as would be expected. The problem seems to be that the shell function rvm is defined for my user, but when running sudo, it doesn't seem to be available.
My question: What is the correct way to install rubies in a system wide RVM 1.5.2 install?
I'm running Ubuntu 10.04.
If you have existing provisioning scripts that depend on the old system-wide install script, then staying at RVM version 1.3.0 is another option to consider.
(See RVM system-wide install script url broken -- what is replacement?)
It appears that the install scripts have been updated to correct this, so it doesn't appear to be an issue anymore.

Resources