busyloop / lolcat

Rainbows and unicorns!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lolcat no longer working, i have ruby installed.

IAmV0id opened this issue · comments

a_random_lantern@hal-9000:~$ lolcat
bash: /usr/local/bin/lolcat: /usr/bin/ruby2.5: bad interpreter: No such file or directory

I don't know why this is happening all of a sudden, it used to work before.

commented

Looks like your ruby broke. What linux distro is this?

If it has snap you may try: sudo snap install lolcat
(after uninstalling the package that you have installed and that broke)

I have the same problem after updating my system. Ruby is on version 2.7 now.

However, the /usr/local/bin/lolcat script points to ruby 2.5:

$ head /usr/local/bin/lolcat                                                                                                                                                                                              #!/usr/bin/ruby2.5

If I change this to 2.7, I get the following:

echo test | lolcat                                                                                                                                                                                                      Traceback (most recent call last):
2: from /usr/local/bin/lolcat:23:in `<main>'
1: from /usr/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/usr/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': can't find gem lolcat (>= 0.a) with executable lolcat
(Gem::GemNotFoundException)
commented

What OS? Have you tried snap install?

Yes, it didn't change anything. I have also reinstalled ruby.

commented

What OS is this on and how was lolcat installed?

I use ubuntu on WSL:

neofetch
            .-/+oossssoo+/-.               dan@Daniellaptop
        `:+ssssssssssssssssss+:`           ----------------
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 20.04 LTS on Windows 10 x86_64
    .ossssssssssssssssssdMMMNysssso.       Kernel: 4.19.104-microsoft-standard
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Uptime: 6 hours, 37 mins
  +ssssssssshmydMMMMMMMNddddyssssssss+     Packages: 2246 (dpkg), 4 (snap)
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Shell: bash 5.0.16
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   CPU: Intel i7-7500U (4) @ 2.903GHz
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Memory: 330MiB / 6280MiB
ossyNMMMNyMMhsssssssssssssshmmmhssssssso
ossyNMMMNyMMhsssssssssssssshmmmhssssssso
+sssshhhyNMMNyssssssssssssyNMMMysssssss+
.ssssssssdMMMNhsssssssssshNMMMdssssssss.
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
  +sssssssssdmydMMMMMMMMddddyssssssss+
   /ssssssssssshdmNNNNmyNMMMMhssssss/
    .ossssssssssssssssssdMMMNysssso.
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.
$ sudo snap remove ruby
ruby removed 
$ sudo snap install lolcat
snap "lolcat" is already installed, see 'snap help refresh'
$ sudo snap remove lolcat
lolcat removed
$ sudo snap install lolcat
lolcat 100.0.1 from moe (busyloop) installed
$ echo test | lolcat
Traceback (most recent call last):
2: from /usr/local/bin/lolcat:23:in `<main>'
1: from /usr/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/usr/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': can't find gem lolcat (>= 0.a) with executable lolcat
(Gem::GemNotFoundException)
$ whereis ruby
ruby: /usr/bin/ruby /usr/bin/ruby2.7 /usr/lib/x86_64-linux-gnu/ruby /usr/lib/ruby /usr/share/man/man1/ruby.1.gz
$ snap info ruby
name:      ruby
summary:   Interpreter of object-oriented scripting language Ruby
publisher: Ruby core team (rubylang✓)
store-url: https://snapcraft.io/ruby
contact:   info@ruby-lang.org
license:   BSD-2-Clause OR Ruby
description: |
  Ruby is an interpreted object-oriented programming language often used for web development. It
  also offers many scripting features to process plain text and serialized files, or manage system
  tasks. It is simple, straightforward, and extensible.
snap-id: RjAgguCDAawLSJ3IByPe0R92xlNtrfGt
channels:
  latest/stable:    2.7.1  2020-04-01 (181) 28MB classic
  latest/candidate: ↑
  latest/beta:      ↑
  latest/edge:      2.8.0  2020-04-01 (184) 27MB classic
  2.7/stable:       2.7.1  2020-04-01 (181) 28MB classic
  2.7/candidate:    ↑
  2.7/beta:         ↑
  2.7/edge:         ↑
  2.6/stable:       2.6.6  2020-04-01 (180) 26MB classic
  2.6/candidate:    ↑
  2.6/beta:         ↑
  2.6/edge:         ↑
  2.5/stable:       2.5.8  2020-04-01 (179) 24MB classic
  2.5/candidate:    ↑
  2.5/beta:         ↑
  2.5/edge:         ↑
  2.4/stable:       2.4.10 2020-04-01 (178) 26MB classic
  2.4/candidate:    ↑
  2.4/beta:         ↑
  2.4/edge:         ↑
  2.3/stable:       2.3.8  2018-11-08 (109) 33MB classic
  2.3/candidate:    ↑
  2.3/beta:         ↑
  2.3/edge:         ↑
commented

What does which lolcat say? 🤔

$ which lolcat
/usr/local/bin/lolcat
$ head "$(which lolcat)"
#!/usr/bin/ruby2.7
#
# This file was generated by RubyGems.
#
# The application 'lolcat' is installed as part of a gem, and
# this file is here to facilitate running it.
#                                                                                                                                                                                                                                               require 'rubygems'

I found a workaround:

sudo mv /usr/local/bin/lolcat lolcat
$ sudo snap remove lolcat.bkp
lolcat removed
$ sudo snap install lolcat

image
Does that work for you? @A-Random-Lantern

commented

Yes, it looks like you had a lolcat installed from a different source
(ever done a gem install lolcat or apt install lolcat in the past?).

Lolcat installed from snap should be located in /snap/bin/lolcat. 🙂

Yes, I used apt previously and I updated using apt (sudo do-release-upgrade). However, lolcat was not available there after the update.

commented

Hmm yep. Will need to look into ways to make this all less confusing.
Glad you figured it out tho 👍

Let's see if it works for the original poster, too.

Yeah it worked for me, thanks.

Late reply I know

I encountered the same problem on Linux Mint 21. I had lolcat installed, via apt I think, on Mint 20.3, and all worked. But now:

$ lolcat
bash: /usr/local/bin/lolcat: /usr/bin/ruby2.7: bad interpreter: No such file or directory
$ which ruby
/usr/bin/ruby
$ ruby --version
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
$ apt list ruby
Listing... Done
ruby/jammy,now 1:3.0~exp1 amd64 [installed]
ruby/jammy 1:3.0~exp1 i386

EDIT: on the proposed workaround: Linux Mint does not have snaps enabled by default, and I do not fancy enabling them.

commented

I don't know the ruby setup in mint but you can most likely fix it
with gem install lolcat (or sudo gem install lolcat).

You may need to remove any previously installed version first
(either with the package manager you used, or with sudo rm -f /usr/local/bin/lolcat)

@m-o-e

Marvellous: that worked. Thank you. I did indeed have to use sudo.

Ah: sorry to bang on, but suddently I see the following!

neofetch | lolcat
/usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1401:in `rescue in block in activate_dependencies': Could not find 'paint' (~> 2.1) among 94 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/home/<redacted>/.gem/ruby/3.0.0:/var/lib/gems/3.0.0:/usr/local/lib/ruby/gems/3.0.0:/usr/lib/ruby/gems/3.0.0:/usr/lib/x86_64-linux-gnu/ruby/gems/3.0.0:/usr/share/rubygems-integration/3.0.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/3.0.0' at: /var/lib/gems/3.0.0/specifications/lolcat-100.0.1.gemspec, execute `gem env` for more information
	from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1398:in `block in activate_dependencies'
	from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1387:in `each'
	from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1387:in `activate_dependencies'
	from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1369:in `activate'
	from /usr/lib/ruby/vendor_ruby/rubygems.rb:286:in `block in activate_bin_path'
	from /usr/lib/ruby/vendor_ruby/rubygems.rb:285:in `synchronize'
	from /usr/lib/ruby/vendor_ruby/rubygems.rb:285:in `activate_bin_path'
	from /usr/local/bin/lolcat:25:in `<main>'
/usr/lib/ruby/vendor_ruby/rubygems/dependency.rb:311:in `to_specs': Could not find 'paint' (~> 2.1) among 94 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/home/<redacted>/.gem/ruby/3.0.0:/var/lib/gems/3.0.0:/usr/local/lib/ruby/gems/3.0.0:/usr/lib/ruby/gems/3.0.0:/usr/lib/x86_64-linux-gnu/ruby/gems/3.0.0:/usr/share/rubygems-integration/3.0.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/3.0.0' , execute `gem env` for more information
	from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1399:in `block in activate_dependencies'
	from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1387:in `each'
	from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1387:in `activate_dependencies'
	from /usr/lib/ruby/vendor_ruby/rubygems/specification.rb:1369:in `activate'
	from /usr/lib/ruby/vendor_ruby/rubygems.rb:286:in `block in activate_bin_path'
	from /usr/lib/ruby/vendor_ruby/rubygems.rb:285:in `synchronize'
	from /usr/lib/ruby/vendor_ruby/rubygems.rb:285:in `activate_bin_path'
	from /usr/local/bin/lolcat:25:in `<main>'

. . And, after reinstalling lolcat, again, the problem disappeared once more. I reinstalled lolcat via apt. So that was the needful in my case.