Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
rails gives an error about railties,
In an attempt to uninstall and reinstall rails, I tried gem uninstall rails and nothing happened.
$ rails
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'railties' (>= 0.a) among 18 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/apple/.gem/ruby/2.3.0:/Library/Ruby/Gems/2.3.0:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0', execute `gem env` for more information
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from /usr/local/bin/rails:25:in `<main>'
From what I remember of how I got into that situation, rails was working ok, but I had an issue that arrow keys weren't working in irb. They were showing ^A , ^D, ^B, ^C
I managed to fix that by doing a command- brew upgrade. And I did brew install ruby, which told me to do brew reinstall ruby and i did that, and it told me to set the PATH . PATH="/usr/local/opt/ruby/bin:$PATH" . so I did that.
But I still get an error about railties
$ PATH="/usr/local/opt/ruby/bin:$PATH"
$ echo $PATH
$ rails
Traceback (most recent call last):
2: from /usr/local/bin/rails:23:in `<main>'
1: from /usr/local/Cellar/ruby/2.6.3/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
/usr/local/Cellar/ruby/2.6.3/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem railties (>= 0.a) with executable rails (Gem::GemNotFoundException)
I just tried gem uninstall rails, having made sure the path was updated
and I get this
~/rubymac$ gem uninstall rails
Successfully uninstalled rails-5.2.3
~/rubymac$ rails
rails new APP_PATH [options]
So this is just an evolving mess..
rails<ENTER> gives no error now, rails seems installed.. but the gem command thinks rails is uninstalled
If I do rails new asdfj . then I get
/usr/local/Cellar/ruby/2.6.3/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (1.17.2) required by your /Users/apple/rubymac/asdfj/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.2`
I also have two versions of Ruby, which I don't want, I only want one.
~$ cd /usr/local/opt/ruby/bin
/usr/local/opt/ruby/bin$ ls
bundle bundler erb gem irb rake rdoc ri ruby
/usr/local/opt/ruby/bin$ echo $PATH
/usr/local/opt/ruby/bin$ which gem
/usr/local/opt/ruby/bin$ cd ~/
~$ /usr/local/opt/ruby/bin/ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin16]
~$ /usr/bin/ru
ruby runocc.d
~$ /usr/bin/ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin16]
~$ rails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.