1
Aldar
4y

It is currently 5:30 AM, I've been trying to upgrade a server by one single major OS release for the last 3.5 hours. All major apps were no issue, except one.

Redmine.

That thing runs on Ruby.

Ruby, as it turns out, doesn't really like the way Debian handles package management.

And now, I have Redmine that, even if I completely uninstall / reinstall, won't start

I went down several rabbit holes, trying to operatively find what the issue is. But I never got to the key issue.

Fuck ruby. Fuck Redmine. Fuck nothing-saying error messages. Fuck bundle. Fuck gem. Fuck it all.

I'm redirecting the Redmine domain onto the server backup I've made. Upgrading that thing is a nightmare.

Maybe now I can finally go to bed...

Comments
  • 0
    really? this is interesting, I have never had issues with Ruby on debian systems, maybe because i just go for automation tools or web dev using rvm. What makes it break on your case?
  • 0
    @AleCx04 nor have I (and I second rvm).

    Version mismatch?
    Moved binaries?
  • 0
    @AleCx04 @Root Excuse my late reply... I was sleeping.

    My issue is - I'm not a ruby dev. I never really had to deal with ruby. I have no idea what best practices there are. All I needed was to upgrade Redmine by one major version.

    I tried looking at upgrade guides, but I could only find them for manual compilation from source, not when one has a system maintainer package.

    I hoped running apt-get dist-upgrade would be enough but it wasn't.

    Along the way, I got such fun errors such as dependency issues where the newer version of thin (The webserver of choice for Redmine) required newer Bundler than there was on my system, and unlike with Python, upgrading that wasn't as easy as running a single command.

    I tried following advice the errors were giving me. Tried googling around. But alas, after 2 hours, I just booted up the old version from a server backup I had...

    My final point is - If you need to be a Ruby dev to just upgrade a system packaged SW... Something's wrong with it.
  • 0
    @Aldar That really shouldn’t be a requirement. And honestly, I’ve never had any issues upgrading software written in ruby either.

    I wouldn’t blame the language for this, even though it’s tempting.

    Iv’e had endless problems upgrading software written in python before, and i really really wanted to blame the tools for it (like pip). But in reality it was probably some fluke or complicated mess that would have given anyone trouble. (I also gave up here and did something else.)
  • 0
    Yeah.

    No.

    Ugh.

    The trouble of package management starts at the moment where things don't match the expected system environment.

    System environment - the packaged, fixed versioned, language interpreter that sits at certain pathes.

    What most people don't get taught, sadly: nearly every interpreter can run his installer (yarn, npm, pip...) as a normal user.

    alas: don't touch the system. it ends bad.

    And I can understand the pain of the author quite well...

    One bad step, one missing argument e.g. for an install script that then overwrites certain system parts and you'll have nightmares finding out what really happened.

    Had this several times and learned it the hard way.

    Don't touch the system.

    /usr is forbidden, /bin and /sbin a terrible idea.

    Easiest way: create a seperate user, run all commands as the seperate user.

    Look for arguments the installer (yarn, bundler, pip....) provides to run in user mode.

    If you must run it as root, which should be the last resort, look at /opt .

    Create a dummy user, create a dummy directory at /opt, give it the user:group permissions for the dummy user and try to install it there as the dummy user.

    If the dummy user tries to do dummy stuff by writing outside /opt, e.g. /usr it will fail with EACCESS.

    Which is far better than suddenly having poop on the console cause things broke.

    :(

    It doesn't really matter which language, be it Ruby / Python / JS / ...

    One of the reasons I hate sites mentioning sudo.

    This is like hiding a claymore under a doormat.

    Of course your guests are welcome to come to your house, as long as they don't step on the landmine you so gracefully planted as a welcome present....
Add Comment