zerosleeps

Since 2010

New Rails projects still wet the bed

Friday 2 July 2021

Here we go again. Past all the Ruby/Rubygems/Node.js/Yarn nonsense and on to creating a shiny new Ruby on Rails project:

% ruby --version
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin20]
% rails --version
Rails 6.1.4
% rails new foo

At this point you’ll have about 150 gems installed and 687 (!) folders in node_modules 🙄 Anyway, switch to the brand new, everything-as-per-defaults project and run rails test:

% cd foo
% ./bin/rails test

And what do you know?

/Users/scott/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:34:
in `require':
cannot load such file -- rexml/document (LoadError)

There’s an issue about this but it’s been closed with a “not our problem” type of response:

This is an issue with selenium-webdriver … Could you please report there?

But the thing is Rails developers, the dependency on selenium-webdriver is your dependency. It’s in the Gemfile created by default. Out of the box Rails does not work.

I believe this is the first time I’ve attempted to spin up a new Rails application since my last rant back in January, and it’s sad that I wasn’t in the least bit surprised that the defaults don’t work.

I can only assume Rails isn’t interested in attracting new users, because goodness knows why anyone would put up with the amount of shit you need to know about and debug from the first minute of using this stuff.