Jordan Lejman
Jordan Lejman

Reputation: 85

Trouble Setting Up Ruby On Rails

I'm attempting to start learning Ruby on Rails via a YouTube tutorial series(https://www.youtube.com/watch?v=GY7Ps8fqGdc), but seem to be struggling getting everything properly installed and set up to do so. The tutorial requires MySQL with MySQL Workbench and Ruby on Rails. I've gotten several errors in the first few steps and taken some steps to try to resolve them, here's basically where I've gotten.

Installed the most recent version of MySQL and Ruby on Rails. I ran the rails new [name] -d mysql command without issue and it ran to completion. I then navigated to the newly created project folder and ran the bundle install at which point I was given the following error:

Gem::InstallError: nio4r requires Ruby version >= 2.3.
An error occurred while installing nio4r (2.5.2), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.5.2'` succeeds before bundling.

At this point I installed version 2.6 of Ruby on the machine, which did not seem to yield any improvements. Basically I think I'm overcomplicating all of this and want to know if anyone has an easy solution to install all the tools required for working in Ruby on Rails.

Thanks

Upvotes: 0

Views: 113

Answers (1)

Javier Roque
Javier Roque

Reputation: 196

First thing first, you're following a 5 yr old tutorial on youtube. I would advise to always follow the newer ones even though some of the old ones might still work and the reason is simple; recent tutorials will probably work off the bat.

Now, judging by the video you shared, I can see that you should've installed RVM at some point. Official RVM website

In your terminal run ruby -v and check if you're actually using the Ruby version you just downloaded. To change the ruby version while using rvm you should use in your terminal:

$ rvm list

To check on your available ruby versions installed and then

$ rvm use <version>

This will switch your ruby version to the one you want. ( If you already installed it of course. ) and then try bundle install again.

Since you were asking for an easier solution I'd say to try following Rails official getting started guide. This guide installs the minimum amount of gems which will help you avoid all these version issues and even though it uses sqlite instead of mysql, later on you will be able to switch to mysql if you want with a better understanding of it.

Upvotes: 1

Related Questions