[SOLVED] First rails application


#1

I tried running my first ruby rails application after entering the command

rails server

terminal sent back

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

also the app doesn’t appear when I go to http://localhost:3000/cars

anyone know how to fix this?? thank you.


#2

UPDATE:

Dgheen@dalannahs-mbp my_first_rails_app % rails generate scaffold car make:string model:string year:integer
Running via Spring preloader in process 44685
      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.
Dgheen@dalannahs-mbp my_first_rails_app %

Is this a routing issue?? now sure how to fix it. from what I’ve gathered on Discord many have been struggling with the first ruby rails tutorial. Would like to complete but maybe best just to move forward at this point…


#3

@dgheen
Can you try destroying the scaffold and rerunning it?:

rails destroy scaffold car make:string model:string year:integer

Then:

rails generate scaffold car make:string model:string year:integer

And if you haven’t migrated already, run:

rake db:migrate

To check if you have migrated already, take a look at the db/schema.rb file in your project. In it, you should see mentions of a cars table, along with all its attributes like make, year, model, etc.


#4

@pico Thank you for your response. This issue was recently resolved. I had installed both rvm and rbenv. This was causing conflict so I uninstalled rvm and it worked from there.


#5

Glad to hear it!


#6

This worked for me as well thank you!