from_with tag causing internal server error in Rails

64 Views Asked by At

I'm new to Ruby on Rails and am following the online tutorial here: https://guides.rubyonrails.org/getting_started.html

As soon as I try to implement a 'form_with' element I get the following error in the terminal:

Started GET "/articles/new" for 127.0.0.1 at 2020-04-22 12:57:00 +0930 Processing by ArticlesController#new as HTML Rendered articles/new.html.erb within layouts/application (8.2ms) Completed 500 Internal Server Error in 38ms (ActiveRecord: 0.0ms)

I've been able to complete the tutorial successfully up until this stage, which has included making controllers, views and routing. Up until this point I've been able to access the pages in my browser no problems. I've tried searching but can't seem to find an explanation online. I'm running rails using Ubuntu on my Windows laptop.

If anyone can point out the issue or forward me somewhere that does I'd be super grateful!

Tips on how to debug would also be helpful, so far this is the only message printing to the terminal which seems rather ambiguous.

UPDATE

I read of others having issues running rails on Windows so I tried to attempt the same process on Ubuntu running within a virtual machine but I'm getting the same problem. Could this be a versions issue? I updated my rails to version 4.2, ruby is still version 2.5.1

I really want to get moving and this problem is taking a lot of time, any help is super appreciated !

1

There are 1 best solutions below

0
Patrik Beck On

I got pass the problem by installing a newer rails: 5.1

Ubuntu:

sudo gem install rails --version=5.1

However, the already created "blog" tutorial project preserved its rails version. I end up deleting the "blog" directory and starting the whole process over.