First Rails app can't access localhost:3000/cars


#1

hi, i am trying out my first ruby on rails app
and i followed the steps correctly but can’t access http://localhost:3000/cars

[i dont even know what is the problem bc i have done everything accordingly]
https://www.theodinproject.com/courses/web-development-101/lessons/your-first-rails-application?ref=lnav this is what i am following

i also cannot cd into ‘my_first_rails_app’

pls help! I am new to ruby


#2

I would go back and follow the steps again.


#3

Hi! Thanks so much for replying me. I have tried that already, but it still does not work.

After I enter “rails generate scaffold car make:string model:string year:integer”

there’s an error message that says

RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment
Running via Spring preloader in process 25669
invoke active_record
The name ‘Car’ is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.

When I try to go to server it has a bunch of error code and it says in bold

“ebpacker configuration file not found /Users/liroufoong/odin_on_rails/my_first_rails_app/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /Users/liroufoong/odin_on_rails/my_first_rails_app/config/webpacker.yml (RuntimeError)”

  • can you help with this?

#4

What version of ruby and rails are you using?


#5

ruby 2.6.4
rails -v 5.2.3


#6

You can try running spring stop in the terminal when in the rails project folder.

Then you should be able to try restarting the server.


#7

@liroufoong I’m having the exact same issue. Using Ruby 2.6.3p62 Rails 6.0


#8

@liroufoong Resolved! I deleted the my_first_rails_app folder and went through the steps again from 1.3 and it worked.