Question: I am trying to establish a rails environment. I can't use the latest version (6) because my computer needs admin rights to install NodeJS and Yarn. So I have to use an older version (say rails v4.2.2).

Trouble is, when I install this, the Bundle doesn't allow me to create a demo (using 'rails new demo'). I have tried various options but always get an error that the Bundle in incompatible.

I did manage one successful combination (rails v4.2.2 and Bundle v1.17.3) but when trying to run the server ('rails server') I get a BigDecimal error. So it seems that combo is not great either.

Essentially, could anyone advise of an installation procedure (with versions) that would lead to a successful server being run?

Answer: 
The most important question is not which bundler version to use but which Ruby version.

Ruby 2.4 unified `Fixnum` and `Bignum` to `Integer` and that change is not supported by old Ruby on Rails versions. At the same time, Ruby on Rails usually requires a minimum Ruby version – for Ruby on Rails 4.2 that was >= 1.9.3.

Therefore I would try Ruby `2.3.8` when I had to run an old Ruby on Rails 4.2 application.

Keep in mind that Rails 4.2 is unmaintained and doesn't get any security updates anymore. I cannot recommend using it anymore. When you only plan to use it as a learning exercises and do not plan to release your application on a public server, it might feel like an old version would still be safe to use. But Rails moves fast, you would learn things that might be done differently on newer version. And upgrading your application later on might be painful too. Therefore I recommend always use the latest available version for Rails when starting a new project.
Looking at my Gemfile.lock, we can safely assume rails (4.2.8) insists on bundler version to be less than 2.x:

```
rails (4.2.8)
  actionmailer (= 4.2.8)
  actionpack (= 4.2.8)
  actionview (= 4.2.8)
  activejob (= 4.2.8)
  activemodel (= 4.2.8)
  activerecord (= 4.2.8)
  activesupport (= 4.2.8)
  bundler (>= 1.3.0, < 2.0)

```