# rbenv

Published articles for rbenv.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Declaring Ruby Bankruptcy, The Ruby Psych 3.1 Issue, RVM and RBEnv

DevFeed: [Declaring Ruby Bankruptcy, The Ruby Psych 3.1 Issue, RVM and RBEnv](<https://devfeed.tech/articles/declaring-ruby-bankruptcy-the-ruby-psych-3-1-issue-rvm-and-rbenv-28316.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/ruby/2022/06/15/declaring-ruby-bankruptcy-the-ruby-psych-3-1-issue-rvm-and-rbenv.html>)

Author: Fuzzygroup

Published: 2022-06-15T06:35:00Z

Content type: opinion

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [Development](<https://devfeed.tech/topics/development.md>), [legacy](<https://devfeed.tech/topics/legacy.md>)

Tags: [errors](<https://devfeed.tech/tags/errors.md>), [installation](<https://devfeed.tech/tags/installation.md>), [legacy](<https://devfeed.tech/tags/legacy.md>), [rails](<https://devfeed.tech/tags/rails.md>), [rake](<https://devfeed.tech/tags/rake.md>), [rbenv](<https://devfeed.tech/tags/rbenv.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [rvm](<https://devfeed.tech/tags/rvm.md>), [zsh](<https://devfeed.tech/tags/zsh.md>)

### AI overview

A developer describes problems after installing Ruby 3.1 with RVM, including missing psych and failures in bundle install, irb, Rails console, rake, and switching Ruby versions. After removing RVM and rbenv, the author plans to use RVM for Ruby 3.1 and later and rbenv for older projects.

### Source excerpt

I had a bloody awful Sunday three days ago. I had started work on a new application that had Ruby 3.1 set in its Gemfile and I blithely installed Ruby 3.1 using RVM. And then my life began to suck slimy green toads with errors like this: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby. I'd like to say that I wasn't quite as diligent in fixing this because, well, it was sunday. However, given the readiness by which most of us generally install new versions of ruby, that wasn't it. We simply aren't used to breaking changes with Ruby. The ctrl blog does a great job of describing this. Thank you. The basic issue is that psych is a low level gem and once it changes, well, your world kind of just breaks. What I pretty much found out immediately is that every single thing I wanted to do with Ruby just failed: bundle install irb rails c rake And, "drum roll" - changing over to a different ruby The fact that I couldn't change over to a different ruby basically meant that I was screwed. I don't think that this was intended. And it is entirely possible that this was some kind of whacky interaction on a development system with, ahem, a lot of rubies and crazy legacy conflicts but that is what happened. Declaring Ruby Bankruptcy Since I couldn 't change rubies, everything just devolved into an amazing pool of suckitude. Not only couldn't I use Ruby, I couldn't blog, run any of my utility scripts, etc. My final answer was to declare ruby bankruptcy and: delete rvm delete rbenv delete all references to rvm and rbenv from zsh and other profile files reboot rm -rf ~/.rvm rm -rf ~/.rbenv reboot I've been a long time Ruby user so this process exposed some craziness like 2.3.1 log files owned by root which couldn't be deleted. Taking a Break This was the point where I threw my hands up, walked away an

## Installing Ruby using rbenv on Ubuntu 18

DevFeed: [Installing Ruby using rbenv on Ubuntu 18](<https://devfeed.tech/articles/installing-ruby-using-rbenv-on-ubuntu-18-28308.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/ruby/2020/02/14/installing-ruby-using-rbenv-on-ubuntu-18.html>)

Author: Fuzzygroup

Published: 2020-02-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [Ubuntu](<https://devfeed.tech/topics/ubuntu.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [apt](<https://devfeed.tech/topics/apt.md>), [Git](<https://devfeed.tech/topics/git.md>)

Tags: [apt](<https://devfeed.tech/tags/apt.md>), [bash](<https://devfeed.tech/tags/bash.md>), [git](<https://devfeed.tech/tags/git.md>), [rbenv](<https://devfeed.tech/tags/rbenv.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [ubuntu](<https://devfeed.tech/tags/ubuntu.md>)

### AI overview

A practical guide to installing Ruby 2.7.0 with rbenv on Ubuntu 18, including required packages, rbenv and ruby-build setup, shell configuration, and selecting the installed Ruby version globally.

### Source excerpt

Rbenv provides a powerful tool for installing ruby on whether on your local box or on your server environment. While I have traditionally used RVM for local ruby development, I have found RVM problematic for use in a server context. As long as you are using bash -lc along with things like CRON jobs or System D, rbenv seems to be a great server side tool. My inspiration for this came from the Digital Ocean docs. As always, Digital Ocean does a great job on documentation. Here are the steps to get rbenv installed: sudo apt-get install rbenv rbenv sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev git clone https://github.com/rbenv/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc source ~/.bashrc git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build rbenv install -l | grep 2.7.0 rbenv install 2.7.0 rbenv global 2.7.0 Here are the lines from my history file showing my flailing as I attempted to get rbenv installed. 307 rbenv 308 rbenv install 2.7.0 309 rbenv install --list | grep 2.7 310 cd ~/.rbenv/plugins/ruby-build 311 which ruby-build 312 /usr/bin/ruby-build --version 313 cd ~/.rbenv/plugins/ruby-build 314 sudo apt-get upgrade ruby-build 315 /usr/bin/ruby-build --version 316 rbenv install --list | grep 2.7 317 sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev 318 git clone https://github.com/rbenv/rbenv.git ~/.rbenv 319 echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc 320 echo 'eval "$(rbenv init -)"' >> ~/.bashrc 321 source ~/.bashrc 322 type rbenv 323 git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build 324 rbenv install -l 325 rbenv install -l | grep 2.7.0 326 rbenv install 2.7.0 327 rbenv global 2.7.0 328 pwd

## Making Ruby Scripts work Under System D Using rbenv

DevFeed: [Making Ruby Scripts work Under System D Using rbenv](<https://devfeed.tech/articles/making-ruby-scripts-work-under-system-d-using-rbenv-28307.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/ruby/2020/02/13/making-ruby-scripts-work-under-system-d-using-rbenv.html>)

Author: Fuzzygroup

Published: 2020-02-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [systemd](<https://devfeed.tech/topics/systemd.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Shell](<https://devfeed.tech/topics/shell.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [rbenv](<https://devfeed.tech/tags/rbenv.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [shell](<https://devfeed.tech/tags/shell.md>), [systemd](<https://devfeed.tech/tags/systemd.md>)

### AI overview

This tutorial explains why Ruby scripts using rbenv fail when launched by systemd and shows that invoking Bash with -lc in ExecStart and ExecReload loads the required shell extension.

### Source excerpt

This has bit me I think every single time I make a SystemD launch script using ruby and rbenv (RVM is worse; imho). Perhaps writing it down for once makes the lesson stick. Let's start with our SystemD unit file that doesn't work: [Unit] Description=Twitter To Kafka [Service] SyslogIdentifier=twitter_to_kafka User=ubuntu PIDFile=/home/ubuntu/twitter_to_kafka/twitter_to_kafka.pid WorkingDirectory=/home/ubuntu/twitter_to_kafka ExecStart=/home/ubuntu/twitter_to_kafka/twitter_to_kafka.sh ExecReload=/home/twitter_to_kafka/twitter_to_kafka/twitter_to_kafka.sh ExecStop=/bin/kill -s QUIT $MAINPID Restart=always [Install] WantedBy=multi-user.target This generates errors like these: ❯ sudo systemctl status twitter_to_kafka.service ● twitter_to_kafka.service - Twitter To Kafka Loaded: loaded (/lib/systemd/system/twitter_to_kafka.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2020-02-13 12:57:48 UTC; 1min 54s ago Process: 7615 ExecStart=/home/ubuntu/twitter_to_kafka/twitter_to_kafka.sh (code=exited, status=203/EXEC) Main PID: 7615 (code=exited, status=203/EXEC) Feb 13 12:57:48 ip-172-31-24-213 systemd[1]: twitter_to_kafka.service: Main process exited, code=exited, status=203/EXEC Feb 13 12:57:48 ip-172-31-24-213 systemd[1]: twitter_to_kafka.service: Failed with result 'exit-code'. Feb 13 12:57:48 ip-172-31-24-213 systemd[1]: twitter_to_kafka.service: Service hold-off time over, scheduling restart. Feb 13 12:57:48 ip-172-31-24-213 systemd[1]: twitter_to_kafka.service: Scheduled restart job, restart counter is at 5. Feb 13 12:57:48 ip-172-31-24-213 systemd[1]: Stopped Twitter To Kafka. Feb 13 12:57:48 ip-172-31-24-213 systemd[1]: twitter_to_kafka.service: Start request repeated too quickly. Feb 13 12:57:48 ip-172-31-24-213 systemd[1]: twitter_to_kafka.service: Failed with result 'exit-code'. Feb 13 12:57:48 ip-172-31-24-213 systemd[1]: Failed to start Twitter To Kafka. The problem is that rbenv is a shell extension so the shell has to be lo

## MacOS Catalina, ruby bad interpreter error

DevFeed: [MacOS Catalina, ruby bad interpreter error](<https://devfeed.tech/articles/macos-catalina-ruby-bad-interpreter-error-37308.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/macos-catalina-ruby-bad-interpreter-error/>)

Author: Stanko

Published: 2019-12-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [macOS](<https://devfeed.tech/topics/macos.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Homebrew](<https://devfeed.tech/topics/homebrew.md>), [Jekyll](<https://devfeed.tech/topics/jekyll.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [error](<https://devfeed.tech/tags/error.md>), [homebrew](<https://devfeed.tech/tags/homebrew.md>), [issue](<https://devfeed.tech/tags/issue.md>), [jekyll](<https://devfeed.tech/tags/jekyll.md>), [macos](<https://devfeed.tech/tags/macos.md>), [rbenv](<https://devfeed.tech/tags/rbenv.md>), [ruby](<https://devfeed.tech/tags/ruby.md>)

### AI overview

This troubleshooting article explains a Ruby "bad interpreter" error that prevented Jekyll from running after upgrading macOS to Catalina. The author found that Ruby gems were installed with the Homebrew Ruby, but the executable binaries were not linked correctly, and resolved the issue by adding the gems/bin directory to PATH. After a later Big Sur update, the author switched to rbenv because the same fix did not work.

### Source excerpt

Another Catalina rant, this time about Ruby. As far as I know, on MacOS, it is advisable to leave system Ruby version to the OSFor example users don't have write permission on the system's gems folder. , and install a separate version for development. I had one installed via Homebrew, and never had any issues with it. But after Catalina upgrade, I couldn't run Jekyll. Every time it would fail with the following error: $ jekyll -bash: /usr/local/bin/jekyll: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory I checked my bash profile and run which ruby to make sure I'm using the one installed by brew, and everything seemed to be in order. # .bash_profile export PATH="/usr/local/opt/ruby/bin:$PATH" # bash $ which ruby /usr/local/opt/ruby/bin/ruby After quick internet search I learned a lot of people are having similar problems after system upgrade, but I couldn't find the solution. I've tried reinstalling ruby, setting GEM_HOME, altering PATH in /etc/profile and /etc/bashrc, removing and reinstalling gems, but nothing worked. Then I tried to see which Jekyll binary is used and realized - for some reason gems were installed using the correct ruby version, but binaries weren't linked properly. So the solution was pretty easy at the end, all I had to do is to find gems/bin folder and add it to my path. # Use ruby installed by brew export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.6.0/bin/:$PATH" It looks like a common sense, but it took me a couple of hours to figure it out. Hopefully this will save time people facing the same issue. Big Sur update (December 2020) # I got the same error after updating to Big Sur, but this time I couldn't solve it. I still don't know what I was doing wrong. In the end I started using rbenv to manage ruby installations, and it works flawlessly.