My first rails project 1.3


#1

When I try and do the command:
rails destroy scaffold car make:string model:string year:integer

i am returned with this result :
rbenv: version `ruby-2.6.3’ is not installed (set by /Users/alexisreynolds/my_first_rails_app/.ruby-version)

I ended up installing rbenv version 2.6.3 and then did this command again:
rails destroy scaffold car make:string model:string year:integer

and was returned with this:
rbenv: rails: command not found

The `rails’ command exists in these Ruby versions:
2.6.5

SOO… I uninstalled 2.6.3 and got the same result as before… can anyone help me and let me know what I’m doing wrong please? & thank you!


#2

If you install a new ruby version it uses it won’t access the gems installed under a different version as there can be compatibility issues.

You can either install the version of rails in your ruby 2.6.3 version of just prepend any rails command with bundle exec which uses the rails version specified in your Gemfile.

bundle exec rails destroy etc etc for example.