Traceback Problem With Rails New


I am all new to Ruby and Ruby on Rails. I entered Rails new myProject in order to create a new project, but I get the following error message:

Traceback** (most recent call last):

2: from /usr/local/bin/rails:23:in `<main>’

1: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path’

/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe’: can’t find gem railties (>= 0.a) with executable rails ( Gem::GemNotFoundException **)

How can I resolve this problem?