I am trying to build a new application or check the version of rails. I get the following error:
Traceback (most recent call last):
2: from /usr/local/bin/rails:22:in `<main>'
1: from /Users/vivanksharma/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:263:in `bin_path'
/Users/vivanksharma/.rbenv/versions/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)
I searched many different solutions, but none of them worked for me.
Any help would be great.
ruby -v ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
rbenv -v rbenv 1.1.1
Even executing bundle install
gives an error Could not locate Gemfile
.
I'd to run rvm reset
and it started working. The solution I found was connected with rvm warning "Warning! PATH is not properly set up, /Users/xxx/.rvm/gems/ruby-2.5.3/bin is not at first place.". (OSX Catalina)
try to run
gem install bundler
then run bundle
if you still getting the error then run,
bundle install --path vendor/bundle
I got the same error while creating a new gemset and querying the rails version. In my case, I simply had not installed the rails gem yet.
I just needed to do the following:
for a current stable release:$ gem install rails
to get a specific version, say 5.2.2.0:gem install rails --version=5.2.2.0
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With