Evaluating Ruby in Ruby (2020)
iliabylich.github.io
iliabylich.github.io
Compare to Node or even Elixir, this is a no-go for me. I give up on Rails.
Every Ruby developer I know users rbenv, rvm or asdf to manage their versions and take the permissions and path woes of competing package managers out of the equation entirely.
You need to know this before you start or you're going to have a bad time.
"ME NO CAN INSTALL RAILS" is an entirely different thing. Lately I've noticed how more technical HN posts often get this "turd in the punchbowl" type first comment. I can speculate that a certain popular site has gone down the toilet to the extent that they show up here and are intimidated by some of the contents.
The file can contain something as simple as
puts "Hello World!"
If you want to install a lightweight web framework, you can try Sinatra [0] or Roda [1] .I've been through the process of installing Ruby on a Linux (Ubuntu 20.04) laptop I got for my new job. Here is how it went:
1. I obviously can't just `sudo apt install ruby` as the version used by projects differ, and also differ from the one in the repositories. This has been an issue since forever with ruby on Linux.
2. Tried installing rvm as this was the method I knew from a long time ago (before I started using docker for local development). The one in the repository could not install ruby properly and the one from rvm.io gave gpg errors.
3. Tried installing rbenv, again the one from repositories had problems when installing ruby versions.
4. Installed homebrew on Linux (yes you heard that right, homebrew, a mac tool, on Linux).
5. Finally managed to `brew install rbenv` and `rbenv install $RUBY_VERSION`.
6. Of course, the normal stuff like needing to install `libpq` and `libffi`, and other build packages, because `bundle install` would not finish successfully without them. Error messages for these are still cryptic, you figure out the issue if you read them carefully, but still a pain.
So yes, it's not necessarily Rails's or Ruby's fault, but it is a struggle today just as it was back in the day. And I think this problem needs to be acknowledged and worked on by the ruby community. It's a shame since ruby itself brought the world a lot of wonderful tools and practices that I think improved developer experience (it certainly did for me) and seeing it being neglected like this is painful.
P.S. Nowadays I do all my development work withing a docker-compose setup, I don't even need ruby installed on my laptop. But I think new joiners in the ruby community need a better on-boarding experience.
I wonder if there are any good arguments against docker for ruby/rails. Would be interested to hear them if there are.
I haven't used docker for ruby/rails yet, but intend to very soon, and really look forward to it.
I only code in 2 languages (R, and ruby) and first installed ruby before I had any computer science experience, and it took me 2 weeks to install (I tried with rbenv, had problems, then followed stack overflow instructions which concerned rvm, which in hindsight borked my install, laughably, but completely innocent mistake at the time). Amazing to learn the terminal, ruby, rails and a bunch of other things all at the same time, but compare that to onboarding to a language like R, which takes 3 minutes from first google search to install (including the remarkable RStudio IDE). 2 weeks Vs 3 minutes.
I love ruby/rails but I think being honest about newbie experience is important. I think ruby/rails communities suffer a little from the curse of knowledge. i.e. lots of very experienced people can't quite fathom how a newbie could even struggle.
I think a good test is whether a smart/leading person from another language or framework can use google to successfully and painlessly get started. If they can get everything up and running in good time, then we're in good shape, but otherwise it's a signal for potential to improve the newbie experience.
All this said, I'm like an excited kid every line of ruby/rails I write.
When I wanted to set it up on another machine I did the same. It also worked.
Then I was pulling down a repo I had been working on and realized I had the wrong ruby version. I knew this because I had an error message that said something like can’t find this ruby version. So then I googled how do I change the active ruby version rails or something. I read the answers and changed the version then it all worked.
I’ve been doing some version of digital development of something or other for a living since about 1997.
Except for switching from trying to find the right page in a book to typing it into google it’s been basically the same process described above every time. Every year, every language.
Not sure rails is special.
Edit - lol downvoted but it's true. Install from source and everything will work. It's also super easy.