Troubleshooting Ruby Installation
In Launching ToolsForProductivity, Part 3, I described the workflow
I set up to blog about ToolsForProductivity. In this post, I would like to
recall some of the challenges I faced earlier with the ruby
installation on Ubuntu 20.04.
I will also describe the solutions I adopted to resolve them.
List of Challenges
These are the challenges I faced while performing a clean install of ruby
on Ubuntu 20.04.
Uninstall RVM Completely
Since I had rvm installed already, I uninstalled it using the suggestion here,
rvm implode
gem uninstall rvm
rm -rf ~/.rvm
rm -rf ~/.rvmrc
The above commands only removed the rvm
software and not its configuration or settings.
Clear RVM Configuration
Environment variables configured as part of rvm
installation continue to persist
$ env | grep rvm | wc -l
5
rvm_prefix=...
rvm_version=1.29.12 (latest)
rvm_bin_path=...
PATH=/home....................
...........................rvm/bin:/home
rvm_path=/home/..../.rvm
We need to remove these settings completely1 to ensure
new installations work correctly. A reference online with similar
issues2 was helpful but did not solve my issue completely.
Later, I found that variables were being set in multiple files
(such as bash_profile
) by using the strace
command3.
$ env | grep rvm | wc -l
0
Modifying the source files help eliminate the issue as shown above.
Resolve the OpenSSL Lib Issue
The openSSL library was a bit challenging to install for me on Ubuntu 20.04.
After reading many suggestions on the internet, this was what fixed the issue for me.
- First, remove existing libssl versions
$ sudo apt-get remove libssl1.1
$ sudo apt-get remove libssl1.0.0
$ sudo apt-get remove libssl1.0-dev
With the above commands all ssl versions software is completely removed.
The idea with the commands below is to use v1.0.0
of libssl
which works
as expected. I guess the older version is a bit more robust and works better,
at least for Ubuntu 20.04.
$ sudo apt install --reinstall libssl1.0.0
$ sudo apt install --reinstall libssl1.0-dev
- Check for the installed versions
$ sudo apt policy libssl1.0-dev
libssl1.0-dev:
Installed: 1.0.2n-1ubuntu5.13
Candidate: 1.0.2n-1ubuntu5.13
Version table: .....
That's it !
Continue with installation of ruby
$ rbenv install 3.2.2
To follow progress, use 'tail -f ...
Downloading ruby-3.2.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz
Installing ruby-3.2.2...
.....
We should now be done with the installation with installing bundler
below!
$ gem install bundler
Issue with running Jekyll
Finally, if you get an issue with running jekyll
itself (as below)
$ bundle install
$ jekyll -version
/usr/bin/env: 'ruby2.7': Permission denied
Then, first uninstall all jekyll versions
$ gem uninstall jekyll
Select gem to uninstall:
1. jekyll-4.2.1
2. jekyll-4.3.1
3. jekyll-4.3.2
4. All versions
> 4
Now, run jekyll
using bundle (after $bundle install
)
$ bundle exec jekyll serve
Conclusion
We had a look at some issues that I faced while doing a clean install of ruby as discussed in Part 3 of Launching Tools For Productivity. The steps to upgrade on Ubuntu 22.04 was straightforward with above in place. In case you have similar issues, I hope the above helps resolve them.
-
Stackoverflow - removing rvm ↩
-
Code Whisperer - Removing RVM Completely ↩