Issues creating blog with 'getting started' tutorial

I’m having trouble working through this:

https://guides.rubyonrails.org/getting_started.html

At the ‘rails new blog’ step, I get error messages telling me to install various gems, which I can’t install because they need version 2.4 and the rails installer only goes up to 2.3.3

I also installed the development kit, which installs version 2.6 in a different folder. I can access that by removing the PATH reference to 2.3.3, but then rails won’t run. Is there a way to get rails installed with the higher Ruby version?

Thanks in advance for any tips!

1 Like

Which system are you using?

Windows 10

I’ve seen this but haven’t tried it.

You install the Linux Subsystem for Windows. Once you’re in there, most of the tutorials, you’ll be able to follow. Another route might be Docker. GitHub - spikewilliams/rails4windocker: Ruby on Rails on Docker for Windows I know, I want to follow this tutorial, and I have to do all this setup? What about the blog in 15 minutes? It can be frustrating.

I used to run rails on XP back in the day. What a pain. http://blog.johnivanoff.com/search/label/rails

1 Like

Hi, Edmund thatch, I spent two weeks facing this same essue im my Windows 10 machine. You need to use the Command Prompt that you are sure about the ruby and Rails versions. Checking on the left black windows, You’ll see ruby version is 2.3.3p222 (which rails installer has installed). Together with it, the Rails version is 5.1.7. On the flip side, the left windows shows us Ruby version as 2.6.5p114 and Rails version as 6.0.2.2. As you might guess, there is not need to change the path variable neither hidden any path if you are on the correct Command Prompt.

[…] which I can’t install because they need version 2.4 and the rails installer only goes up to 2.3.3

Yes, this ruby installer just look at ruby 2.3.3, but you might specify another version. It is writen on that tutorial blog:

If you are working on Windows, you should also install the Ruby Installer Development Kit.

And on this last link, it is said:

If you don’t know what version to install and you’re getting started with Ruby, we recommend you use Ruby+Devkit 2.6.X (x64) installer.

Which I also have chosen. This is the reason I can use both Command Prompt.

After install the apropriated kit, you might face another error related to the Bundle. It is so because Bundle will try to bundle some old gem versions. Which you can avoid installing the last bundle version too. But dont worry, the command line will tell you about it and the apropriated command to type.

Check on the official site of ruby gem the latest version of all gems installed automatically by rails. And change it (if necessary) on the GemFile created by rails after run the rails new blog. And then run bundle install.

If you have any doubt, please let me know.

1 Like

I highly recommend against trying to run Ruby on Windows native.

Instead install WSL2, WSL1 sort of works, but 2 is much faster.

If you go with Windows native tooling you will be stuck with a very large number of broken gems and abysmal filesystem performance.

MS have some instruction here:

WSL2 offers better performance than Mac native on many benchmarks and is a very reasonable alternative for dev on a Windows box.

2 Likes

Thanks for the help everyone! That’s given me a few options. I think I’ll try the Linux Subsystem route. Cheers!

4 Likes