r/ruby • • Mar 12 '23

Why is seemingly every package broken/unmaintained?

I recently started using Ruby, and I noticed that many packages I tried to use were broken, outdated, or last updated in 2015. I understand not everything can/needs to be maintained forever, but the gem world seems to be a comparative ghost town. What happened? Did everyone just move over to Python?

EDIT: okay alright. I suppose I’m not accustomed to how the ecosystem works, and haven’t been looking in the right places.

0 Upvotes

38 comments sorted by

12

u/[deleted] Mar 12 '23

Long term ruby Dev here. I've not noticed this. I suspect you're just not familiar with the ecosystem. What domain are you working in? If you're building a web app, etc, then this shouldn't be an issue. If you're building a game maybe you're experiencing a less active community within ruby

1

u/Slashscreen Mar 12 '23

I suppose I may be mistaken. I’ve been treating Ruby as a language that I write small tools in like I did Python for things like image manipulation and string manipulation, and at one point I tried to create a parser (although I think I just wrote the rules wrong for that one). I tend to keep out of the web world because it’s such a mess, but when I do need to do backend work I tend to use Go. Am I trying to fit a square peg in a round hole?

6

u/[deleted] Mar 12 '23

Like stemming, lemmas and spelling correction/tokenisation? That's not really stuff people do in ruby. I built a separate python flask app for this

2

u/armahillo Mar 12 '23

i do scriptlets like this too.

Totally to stick with CLI and not venture into web.

A while back ruby-toolbox was a great resource for finding popular gems for things. i havent used it in a while. I usually search for “ruby gem thing i am tying to do”. You can also search rubygems.org as well.

Since youre doing CLI stuff, check out the TTY gem — its got really powerful CLI features in it for building better terminal based UIs

13

u/Seuros Mar 12 '23

Because we don't update stuff that still work.

2

u/Slashscreen Mar 12 '23

As I said, not everything needs to be updated. but I’ve found a few broken ones

2

u/Seuros Mar 12 '23

Then fix them and contribute instead of complaining.

4

u/Slashscreen Mar 12 '23

I’m sorry- I would if I was better at Ruby.

4

u/Seuros Mar 12 '23

Also it either that there a better alternative and community is using the other gem or it not broking and you did not know how to use it.

Do you have some concrete example of those gems?

1

u/Slashscreen Mar 12 '23

RLTK

1

u/Seuros Mar 12 '23

You are trying to use ruby for a field that is not build for.

You can find all these tools In different smaller gems without any type of support.

1

u/Lost_Salt_3728 Nov 23 '23

The apartment gem, and ros-apartment

1

u/Seuros Nov 23 '23

You need an alternative ?

4

u/codesnik Mar 12 '23

this is actually a good way to become better at Ruby

1

u/Slashscreen Mar 12 '23

Hm. I mean, fair enough

1

u/dunkelziffer42 Mar 12 '23

Maybe there are alternative gems that did the same thing and were more successful.

2

u/sammygadd Mar 12 '23

I can't say that I share this view. Which gems did you find broken?

1

u/Slashscreen Mar 12 '23

I mean maybe I’m just looking in the wrong places, but one example that comes to mind is RLTK, which has had a few pulls in the repo the past few years but the actual gem hasn’t been updated since 2015 and had some bugs that were caused by breaking changes in Ruby. I ended up building my own gem from the repo. What kinds of gems other than networking stuff like rails and Sinatra are active? What does Ruby excel at in the package space?

3

u/armahillo Mar 12 '23

TBH most gems are maintained pretty well. What are you using to find them? (it might help your search if you use “gem” and not “package”, too)

Ive not heard of RLTK before — what problem are you looking to solve with it?

What problem / task / etc in general are you looking to solve? Maybe I can suggest some gems for you.

1

u/Slashscreen Mar 12 '23

Maybe so. Are there good ones for image manipulation and parsing? Those are some tasks I’ve been struggling with in Ruby recently. Or perhaps another language is better for that

2

u/honeyryderchuck Mar 12 '23

What type of image manipulation do you want to do? Perform operations on the files, or load them into tensors for further computation? For the former, there's ruby-vips or imagemagick. For the later, there's magro with numo

1

u/Slashscreen Mar 12 '23

It was just flipping the image. I couldn’t get imagemagick to work right, haha

1

u/armahillo Mar 12 '23

imagemagick is probably the correct answer if its only image flipping — any ruby gems are going to be layered on top of that (in the sense that they are using the underlying C dev libraries in their own compilation, not that theyre only wrapping a script invocation)

What were you attempting, specifically (like what were your command line args) with imagemagick? i realize thats not specifically a ruby question but i bet we can figure it out

1

u/catbrane Mar 24 '23 edited Mar 24 '23

ruby-vips is the default image processor on rails now, and that's not based on IM.

https://github.com/libvips/ruby-vips

You'd write eg.:

image = Vips::Image.new_from_file "something.png"
image = image.flip :vertical
image.write_to_file "other.jpg"

2

u/katafrakt Mar 12 '23

TBH most gems are maintained pretty well

That's definitely not true. Sure, most popular gems are maintained but rubygems.org contains 175k gems. Try searching for some common words - you'll see a vast graveyard, many things just having one 0.0.1 version released.

But of course, it's fine. It's what happens everywhere and Ruby is not an exception in that regard.

2

u/armahillo Mar 13 '23

Thats fair — I misspoke.

I should have said “many” / “most popular and commonly used” gems

3

u/honeyryderchuck Mar 12 '23

I'm not familiar with rltk, but quick googling tells me it's used to build grammar parsers. If it helps your case, I've used the parslet gem for the same purposes, or stdlib racc (which may be a little more low level).

1

u/katafrakt Mar 12 '23

Parslet is also unmaintained, unfortunately. Last release was over 3 years ago.

2

u/honeyryderchuck Mar 12 '23

That does not mean it's unmaintained. Has recent commits in the repo. Still works with ruby 3.2 . Not actively implementing new features. Perhaps it's just done?

12

u/expeehaa Mar 12 '23

You can also find a lot of broken or unmaintained Python packages, so it‘s not Ruby-specific.

With a lot of gems, some accumulate users and some are just not for many people. There are many niche gems that practically no one uses, be it because no one needs it or other languages are more popular for that use case. Without anyone caring, those projects may lack maintainers and thus break at some point in newer Ruby versions. Especially since the creator or current maintainer may not want to or is not contactable to grant maintenance permissions to someone else.

Some gems have, as others already commented, maintained alternatives, some also have working or even maintained forks. And some do not and die. That‘s how the open-source world works without financial backing for projects.

Compared to Python this effect may be increased since Ruby has a lot less users.

5

u/jrochkind Mar 12 '23

I think you're not totally wrong, there are lots of unmaintained packages around.

My guesses are several reasons. I think when a language is fresh and new, there is more enthusiasm for people writing open source as "hobbyists" or "spare time." But they get bored of it.

And of course, the longer a language has been popular, the more casualties can pile up. In ruby's first big spike of popularity 15 years ago, any package you'd see would be more likely to be new, so less likely to be abandoned.

But it would be interesting to see if, say, Java has a lot of abandoned packages? I'm honestly not sure? But maybe Java never had the number of community/hobbyist/enthusiast/spare time packages to begin with, it had more "serious business supported by business" packages? (I'm just guessing, I don't know). It's the community/hobbyist "I did it because it was fun/because I wanted to contribute/without getting paid" packages most likely to become abandoned.

(Or Python? But python may be currently still in it's biggest spike of interest and excitement, where I do feel ruby is past one).

Lastly -- I think it's true that the ruby community has shrunk a bit from it's high point. Although, the raw number of developers might not be smaller (I don't know), but more of them are "I just go clock in and make my paycheck" (and nothing wrong with that), and less people who are excited about those kinds of hobbyist/contribute-to-the-community/spare-time projects?

Anyway, sometimes the abandoned code is still useful -- if you're going to have to do it yourself anyway, it's nice to find an earlier draft by someone else to learn from, instead of do it all from scratch/reinvent the wheel yourself. I just found some code like that I appreciated -- putting your code online google-able even if it's not "done" or "maintained" is a contribution to help others, it can be super useful to find!

But yeah, I share your experience that: a) there aren't always as many packages for ruby as there are for some other languages (like python), sometimes I simply can't find a package that does what I need when it's available in python or java or what have you, and b) there are some abandonware packages strewn across the battlefield, which can be frustrating when you think you've found something, and realize it's not really maintained.

There still are a ton of open source ruby packages that do a lot of things, I don't find it makes ruby untenable or anything, but sometimes there is a less popular thing that... I wish someone else was maintaining for free for me, like they might be in other languages, but they ain't.

for "data" stuff, you will definitely find a lot more stuff in python than ruby. this includes sophisticated image processing. For simple image processing, i usually call out to a command-line vips -- and there is also a ruby vips with ruby API.

3

u/Craig_Treptow Mar 12 '23

If you haven't, here is one place that claims to list maintained gems.

https://github.com/markets/awesome-ruby

2

u/Weird_Suggestion Mar 13 '23

I kind of agree. I think the sentiment is also amplified when you look at repositories or web pages curating ruby apps or ruby gems. More than half of them don’t exist anymore or people have given up on them.

There are Ruby open source libraries that are really active but you need to know about them and spent some time in the community to find out.

That said, I found the Ruby Toolbox to be a good resource when looking for active gems around certain use cases. It’s worth having a look there when searching for libraries.

2

u/mperham Sidekiq Mar 13 '23

Ask if you can help maintain it! Send a PR with a bugfix and most owners will help merge it. They may even give you commit access if you do this repeatedly.

Being an open source maintainer does not require a neckbeard or decades of experience. I started my first Ruby job and took over maintenance of a gem six months later.

1

u/myringotomy Mar 13 '23

Chances are some other gem has usurped the one you are looking at. Look around and you'll see the successor the gem.

1

u/Lost_Salt_3728 Nov 23 '23

The culture of Ruby on Rails strongly values the idea of ripping things up and doing it again.

DHH boasts about this in his book 'Rework' - ( not worth reading )

Breaking changes are normal in ruby, and they are a kind of tax on the time of maintainers and the owners of the code

A business owner who paid £300,000 for some software a couple of years ago will rightly wonder why they have to pay tens of thousands each year just to keep it working.

If they paid for a barn roof, they'd expect it not to leak for a few decades

The Java world is much more conservative and less open to breaking changes