Search code examples
ruby-on-railsruby

Installed Rails but Got ERROR: can't find gem railties


I'm now using CentOS 8 and I've installed Ruby, gem and Rails.

However, when I tried to validate version of Rails, I got ERROR: can't find gem railties.

I have no idea how to fix it.

Could anyone do me a favor?

Thanks, Alex

enter image description here

Update #1: Could not locate Gemfile enter image description here

Update #2: When I tried to uninstall rails, I got ERROR: Gem 'rails' is not installed

enter image description here


Solution

  • Really appriciate help from @max

    Finally, I fixed this problem by simply creating a user for ruby and using it to install Rails.

    Boom !!!

    Fantastic !!!

    enter image description here

    Instructions

    Install Ruby

    Install Rails