Hacker News new | past | comments | ask | show | jobs | submit login

Don't get me wrong, I love Rails, and have been using it off and on since Rails 2.

It's a really good framework, and for someone like me who needs to stand up a website from time to time it really is the path of least resistance.

What bugs me is the pain of setting up a new laptop to run Rails. I need node, which means npm. I'm a backend guy, I don't understand how to set up node, what order to do things in, etc. I do it rarely enough that it always seems a fight. Eventually I get it done, but I'm never sure why it finally all comes together.

An installer that puts together all the requirements so my rails just works would be great. The rvm installer will set up rails on top of ruby but won't set up the node system underneath it.




'asdf' (a version manager) is great for managing nodejs. I haven't dealt with Ruby before, though.

https://asdf-vm.com/


asdf handles Ruby just fine also. I use asdf for Ruby, Python, Elixir/Erlang, Node, and probably a couple more that I've forgotten.


asdf is awesome. It renders useless each language's own version manager.


>I'm a backend guy, I don't understand how to set up node

I understand that Node is mostly known as a frontend tool and Rails uses it for that, but as far as I remember Node was as least initially developed to bring JavaScript runtime to backends.

Even without a package manager node is just a node.exe under Windows, and I think you just have to download and unpack npm and then put node and npm into your PATH environment variable.


I recently set up a new Win11 laptop and all it took was download Node and install it via the installer. You’re up and running in 90 seconds. Yarn was another 30 seconds (npm i yarn). Even Ruby works well with RubyInstaller, and you can normally develop Rails without WSL if you really want to.


thats the whole premise of rails7: dropping the node dependency...


I've never done rails, please tell me, why does "ruby on rails" need nodejs for?

Also it's fairly easy to install node. Too easy in fact. I wish it was much harder, and required a degree.


Rails lets you use modern JS frontend tools.


It lets you use modern JS frontend tool but you can also choose importmaps route that comes as default in Rails 7 so there is no need for nodejs and you can also say goodbye to the big folder "node_modules"


The Ruby/Rails community is one of the best and most friendly I've seen. But the worst part of it, by far is the hate for JavaScript.

JavaScript is just a tool, like any other. And it's a very important one like it or not. And like it or not it's going to stay here for a long time.

Just have a bit of an open mind and try to learn the basics at least, it will make things easier.


Here is what bothered me with JS and it might sound very stupid:

The idea to have a node_modules that has tens of thousands of folders/files for the simplest package that I needed to install. Ruby has gems, but they have few files, I can easily know where to go to understand how something works or add a debugger.

But just trying to read the name of all those seemed for me always like a task that I dont want to do.

The language itself letting aside some warts is good, can be enjoyed and good code maybe can be written.


What led you to think that Ruby devs don't know the basics of Javascript?


I don't think that.

My last sentence on the parent message was directed to the comment I was replying to (which said they couldn't set up node properly).

What I do think is that there's a huge % of Rails devs that hate on JavaScript as if it were some kind of enemy to beat or something, and often that leads to people not wanting to learn it properly.


A couple of Rails versions ago, I had to deal with webpack and that surely felt like an enemy trying to fight me at every step.

Luckily, I no longer need a PhD in webpack or node packages in order to run rails s successfully.


Have you used nvm? It’s pretty painless in my experience.


One of these should help with setting up a new laptop to run Rails:

https://rails.new

https://rubyonmac.dev


Cool, but why not just use Docker? 2-4GB extra ram overhead and some initial learning curve, add a decent Makefile and.. never worry about local env ever again. Switch back and forth between Mac, Windows, Linux like it's nothing.


Add to this that Rails 7.1 comes with a pre-generated Dockerfile that works quite well out of the box


If you opt to use import-maps I think you can get away without needing node these days, though then you're using import maps and have to deal with that can of worms.


The latest version of Rails 7 works out of the box with importmaps so no node (nor yarn or any other version manager) is required.


It’s still a problem, especially in mid size or large apps. Unless you have someone taking care of the bootstrap process, it inevitably breaks down.

Eventually only one person can get it working so I suppose it’s job security so perhaps it’s not so bad

That’s for every framework though, Rails isn’t that bad, relatively


What are you comparing Node to?

Other typical back ends are more complicated (except Go) Java, C#, Python for example


dotnet new webapi - for apis

dotnet new webapp - for crud

dotnet new react - using react

How is that complicated?


For Java, sdkman is great—essentially as convenient as nvm.

Python is a disaster.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: