0

When I run this command:

rvm reinstall 2.3.0 --with-openssl-dir=`brew --prefix openssl`

my Rails server will run, as well as bundler etc. However, when I end the session, I get this error:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'railties' (>= 0) among 17 total gem(s) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /usr/local/bin/rails:22:in `<main>'

Rails version: 5.0.1 Ruby version: 2.4.0p0

I have no idea what's wrong with my environment but its getting frustrating having to reinstall 2.3.0. I don't even know why reinstalling version 2.3.0 works, it just does.

Gem List

* LOCAL GEMS *

actioncable (5.0.2, 5.0.1)
actionmailer (5.0.2, 5.0.1)
actionpack (5.0.2, 5.0.1)
actionview (5.0.2, 5.0.1)
activejob (5.0.2, 5.0.1)
activemodel (5.0.2, 5.0.1)
activerecord (5.0.2, 5.0.1)
activesupport (5.0.2, 5.0.1)
arel (7.1.4)
bigdecimal (default: 1.2.8)
builder (3.2.3)
bundler (1.14.5)
bundler-unload (1.0.2)
byebug (9.0.6)
coffee-rails (4.2.1)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5, 1.0.4)
debug_inspector (0.0.2)
did_you_mean (1.0.0)
domain_name (0.5.20161129)
erubis (2.7.0)
execjs (2.7.0)
executable-hooks (1.3.2)
ffi (1.9.17)
gem-wrappers (1.2.7)
globalid (0.3.7)
http-cookie (1.0.3)
i18n (0.8.1, 0.8.0)
io-console (default: 0.4.5)
jbuilder (2.6.3, 2.6.1)
jquery-rails (4.2.2)
json (default: 1.8.3)
listen (3.0.8)
loofah (2.0.3)
mail (2.6.4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.10.1, 5.8.3)
multi_json (1.12.1)
net-telnet (0.1.1)
netrc (0.11.0)
nio4r (1.2.1)
nokogiri (1.7.0.1)
pg (0.18.4)
power_assert (0.2.6)
psych (default: 2.0.17)
puma (3.7.1, 3.7.0)
rack (2.0.1)
rack-test (0.6.3)
rails (5.0.2, 5.0.1)
rails-dom-testing (2.0.2)
rails-html-sanitizer (1.0.3)
railties (5.0.2, 5.0.1)
rake (12.0.0, 10.4.2)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
rdoc (default: 4.2.1)
rest-client (2.0.0)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
sass (3.4.23)
sass-rails (5.0.6)
spring (2.0.1)
spring-watcher-listen (2.0.1)
sprockets (3.7.1)
sprockets-rails (3.2.0)
sqlite3 (1.3.13)
stripe (1.57.1)
test-unit (3.1.5)
thor (0.19.4)
thread_safe (0.3.6, 0.3.5)
tilt (2.0.6)
turbolinks (5.0.1)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
uglifier (3.1.1, 3.0.4)
unf (0.1.4)
unf_ext (0.0.7.2)
web-console (3.4.0)
websocket-driver (0.6.5)
websocket-extensions (0.1.2)

RVM Version

Warning! PATH is not properly set up, '/Users/Niall/.rvm/gems/ruby-2.4.0/bin' is not at first place.
         Usually this is caused by shell initialization files. Search for 'PATH=...' entries.
         You can also re-add RVM to your profile by running: 'rvm get stable --auto-dotfiles'.
         To fix it temporarily in this shell session run: 'rvm use ruby-2.4.0'.
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
rvm 1.29.1 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]
user2026178
  • 308
  • 2
  • 4
  • 21
  • It says could not find the `railties` gem. Did you try after adding it to your Gemfile? Check this: http://stackoverflow.com/a/9212169/2651076 – Sinstein Mar 01 '17 at 06:47
  • Possible duplicate of [Rails: Could not find railties](http://stackoverflow.com/questions/9212116/rails-could-not-find-railties) – Sinstein Mar 01 '17 at 06:47
  • I have tried both them. @Sinstein – user2026178 Mar 01 '17 at 06:52
  • Why are you reinstalling 2.3.0 in the first place? Did you install the railties gem for the correct ruby version / gemset? – Flip Mar 01 '17 at 08:03
  • @Flip I found it allowed me to run the server and bundler etc. However I get the error above every time I close my terminal. Can you re explain the question: "Did you install the railties gem for the correct ruby version / gemset?" – user2026178 Mar 02 '17 at 02:48
  • 1
    Have you tried to run `rvm get stable --auto-dotfiles` as suggested in the last error message to set up rmv right? It seems it searches in the gems for Ruby 2.0 for the dependency (in the first errror message). – Flip Mar 02 '17 at 06:52
  • YESSS! Thats it! @Flip – user2026178 Mar 02 '17 at 18:19
  • 1
    @user2026178 I wrote it as a real answer, in case you wanna accept it. – Flip Mar 02 '17 at 19:13

1 Answers1

2

Have you tried to run rvm get stable --auto-dotfiles as suggested in the last error message to set up rmv right? It seems it searches in the gems for Ruby 2.0 for the dependency (shown in the first error message).

Máté
  • 2,294
  • 3
  • 18
  • 25
Flip
  • 6,233
  • 7
  • 46
  • 75