Installfest error, Rails can't find Railties


#1

I’m working my way through installing/updating all the stuff I need to begin the Rails project “Getting your Feet Wet” and I cannot get Rails to even show me the version I’ve installed. Here’s my error message:

find_spec_for_exe': can't find gem railties (>= 0.a) (Gem::GemNotFoundException) from /Users/codybuffaloe/.rvm/rubies/ruby-2.3.4/lib/ruby/site_ruby/2.3.0/rubygems.rb:299:inactivate_bin_path’
from /Users/codybuffaloe/.rvm/gems/ruby-2.3.4/bin/rails:23:in <main>' from /Users/codybuffaloe/.rvm/gems/ruby-2.3.4/bin/ruby_executable_hooks:15:ineval’
from /Users/codybuffaloe/.rvm/gems/ruby-2.3.4/bin/ruby_executable_hooks:15:in `’

I have tried installing railties itself and removing and reinstalling rvm, ruby, and rails. Googling this issue doesn’t bring me any readily available solution so any help would be greatly appreciated.


Installfest Sprint signups
#2

Hey @CodyB

Sorry to hear you’re having these problems.

I would follow these steps in your terminal

rvm install 2.5.0
rvm use 2.5.0
rvm --default use 2.5.0

That will update your Ruby. I know the installfest uses 2.3 but that’s a bit outdated. We didn’t write the installfest so unfortunately don’t control it. We are looking to bring this in house though.

Then open a new terminal and type the following one at a time

gem update --system
gem update bundler
gem install rails

Then try and pick up where you left off in the tutorial.

If you still have an issue let us know.


#3

Thanks, I went through the steps you provided and now my error message reads:

Traceback (most recent call last): 4: from /Users/codybuffaloe/.rvm/gems/ruby-2.5.0/bin/ruby_executable_hooks:15:in
3: from /Users/codybuffaloe/.rvm/gems/ruby-2.5.0/bin/ruby_executable_hooks:15:ineval’
2: from /Users/codybuffaloe/.rvm/gems/ruby-2.5.0/bin/rails:23:in <main>'1: from /Users/codybuffaloe/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:in activate_bin_path' /Users/codybuffaloe/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems.rb:289:infind_spec_for_exe’: can't find gem railties (>= 0.a) with executable rails (Gem::GemNotFoundException)


#4

Sorry to hear you’re still having a problem @CodyB :frowning:

Can you post the output of echo $PATH from your terminal?


#5

Sure thing, it’s:

/Users/codybuffaloe/.rvm/gems/ruby-2.5.0/bin:/Users/codybuffaloe/.rvm/gems/ruby-2.5.0@global/bin:/Users/codybuffaloe/.rvm/rubies/ruby-2.5.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/codybuffaloe/.rvm/bin


#6

@CodyB

Did you install rvm, ruby or rails using the sudo command?


#7

No, I don’t believe I did. Is there a way I can check if that’s the case? I’ve uninstalled and re-installed these so many times I’m not 100% sure I never tried a sudo install, but I know I didn’t use sudo while following your instructions, @CouchofTomato


#8

Which OS are you using?


#9

@CodyB
Try
rvm get head
gem install rails

Then see what rails -v returns in your terminal.


#10

I’m using MacOS(specifically OSX El Capitan). I ran those two and I’m no longer getting anything that says Traceback, but a similar error to before:

/Users/codybuffaloe/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems.rb:271:in find_spec_for_exe': can't find gem railties (>= 0.a) (Gem::GemNotFoundException) from /Users/codybuffaloe/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems.rb:299:inactivate_bin_path’
from /Users/codybuffaloe/.rvm/gems/ruby-2.4.1/bin/rails:23:in <main>' from /Users/codybuffaloe/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:ineval’
from /Users/codybuffaloe/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `’


#11

Thanks Cody,

We seem to be in very different timezones so apologies this is taking a long time to solve.

rvm get head seems to have fallen back to the system Ruby so this is a good time to try tthe following commands again.

rvm install 2.5.0
rvm use 2.5.0
rvm --default use 2.5.0

*Open a new terminal

gem update --system
gem update bundler
gem install rails

One other thing you can do is make sure you haven’t accidentally created a Gemfile or Gemfile.lock in your home directory. rvm and bundler will try to read from there to find gems so if you’ve accidentally created a blank one it could be messing things up.

You can use ls -a in your terminal to view all the files. See if there is a Gemfile as that could be messing up config.

Let me know.


#12

Hi @CodyB, can you let us know the output for this command please? which bundle


#13

which bundle returns /Users/codybuffaloe/.rvm/rubies/ruby-2.5.0/bin/bundle

Fixed! It looks like I did have a Gemfile and a Gemfile.lock in my home directory. After removing them, I reinstalled 2.5.0 and, in a new terminal, I installed rails and now it works! I can type rails -v and I get Rails 5.2.0 !! It is currently building the test_app from the tutorial so I’m back on track!

Thanks again for all your help!


#14

@CodyB

Fantastic. Glad you’re up and running. Enjoy the rest of the course.