You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 18.04安装Ruby 2.1.10时出现'__rvm_make -j4'执行错误求助

Troubleshooting '__rvm_make -j4' Error When Installing Ruby 2.1.10

Hey there, sorry to hear you’ve been stuck on this frustrating installation issue for a full day—let’s break down some additional fixes that might get you past that __rvm_make -j4 error. The problem usually boils down to missing compile dependencies, incompatible system tools, or resource constraints, so let’s tackle each angle:

1. Install All Required Compilation Dependencies

You’ve already installed some libraries, but Ruby 2.1.10 (a pretty old version) needs a full set of build tools and dependencies to compile successfully. Run this to cover any gaps:

sudo apt-get update && sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libgdbm-dev libncurses5-dev automake libtool bison libffi-dev

2. Clean RVM Cache & Force a Fresh Compilation

RVM might be holding onto corrupted cached files from your previous attempts. Clear them out and force a source compile (skipping pre-built binaries which can be problematic for older Ruby versions):

rvm cleanup all
rvm install 2.1.10 --disable-binary

3. Use a Compatible GCC Version

Newer GCC versions (8+) often introduce compatibility issues with older Ruby releases like 2.1.10. Try installing an older GCC version and forcing RVM to use it:

# Install GCC 6 (a safe choice for Ruby 2.1.x)
sudo apt-get install gcc-6 g++-6

# Install Ruby using GCC 6
CC=gcc-6 rvm install 2.1.10

4. Fix Memory Constraints (Common on VMs/Low-RAM Systems)

The make error can pop up if your system doesn’t have enough RAM to handle the compilation. Add a swap file to give your system extra memory:

# Create a 2GB swap file
sudo fallocate -l 2G /swapfile

# Secure the swap file permissions
sudo chmod 600 /swapfile

# Enable the swap file
sudo mkswap /swapfile && sudo swapon /swapfile

# Now try installing Ruby again
rvm install 2.1.10

5. Manual Compilation (If RVM Still Fails)

If RVM continues to misbehave, try compiling Ruby from source directly and then registering it with RVM:

# Download the Ruby 2.1.10 source
wget https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.10.tar.gz

# Extract and enter the source directory
tar -xzf ruby-2.1.10.tar.gz && cd ruby-2.1.10

# Configure the build (point to RVM's rubies directory)
./configure --prefix=$HOME/.rvm/rubies/ruby-2.1.10

# Compile and install
make -j4 && make install

# Tell RVM about this installation
rvm use ruby-2.1.10 --default

If none of these work, could you share the full output from the rvm install command (specifically the part right before the __rvm_make error)? That will help pinpoint exactly where the compilation is failing.

内容的提问来源于stack exchange,提问作者TheVinspro

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 04:11:27