Rails Version 5 - sei-relativity/SEI-Relativity-Wiki GitHub Wiki
- First run this command:
gem uninstall rails
You should see a success message when it's done saying: "Successfully uninstalled rails-< version-number >"
- Second run this command:
gem uninstall railties
You will get a message saying: "If you remove this gem, these dependencies will not be met. Continue with Uninstall?" type "y" for all future messages. You should see a success message when it's done saying: "Successfully uninstalled railities-< version-number >"
- Make a check before installing rails to make sure it has been successfully uninstalled by typing in your terminal:
rails -v
and it should show you a message saying: "rails: command not found"
psst: if it doesn't show try restarting the terminal.
- Now go ahead an install rails version 5.2.3:
gem install rails --version=5.2.3
command: rails -v
message: Rails 5.2.3
psst: if it doesn't show try restarting the terminal.
- Let's get rid of the database we've created so far with rails 6 using these steps:
- in your terminal:
psql
- once you're in psql type:
DROP DATABASE muse_development;
and thenDROP DATABASE muse_test;
Don't forget the semicolons
- in your terminal:
- Remove the old muse file made with rails 6.0
- in your terminal go to the folder containing the muse file, run
rm -rf muse
- recreate the rails file in terminal, run
rails new muse -d postgresql
- create the db, cd into the muse folder, run
rails db:create
,then runrails db:migrate
- test the app, run
rails s
- create the database, run
rails g model Artist name hometown img albums:integer
- migrate the database, run
rails db:migrate
- in your terminal go to the folder containing the muse file, run