luke
luke

Reputation: 1578

Load Error for rails-4.2.4 - will not load

This is the error I get in my terminal when I am trying to spin up rails server or even when I input rails -v.

/Users/lukeduncan/.rbenv/versions/2.2.0/bin/rails:23:in `load': cannot load such file -- /Users/lukeduncan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rails-4.2.4/bin/rails (LoadError)
from /Users/lukeduncan/.rbenv/versions/2.2.0/bin/rails:23:in `<main>'

I have looked into the issue and noticed it may be because I have two versions of ruby installed. But not entirely sure so don't want to remove one just in case. When I gem install rails, it says it updates to the latest 4.2.4 but still does not load once I try to run a rails app or even trying to run rails -v. Other apps that I have also spin up the same error so it is not app specific.

Here is my gemfile.lock

GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.4)
  actionpack (= 4.2.4)
  actionview (= 4.2.4)
  activejob (= 4.2.4)
  mail (~> 2.5, >= 2.5.4)
  rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.4)
  actionview (= 4.2.4)
  activesupport (= 4.2.4)
  rack (~> 1.6)
  rack-test (~> 0.6.2)
  rails-dom-testing (~> 1.0, >= 1.0.5)
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.4)
  activesupport (= 4.2.4)
  builder (~> 3.1)
  erubis (~> 2.7.0)
  rails-dom-testing (~> 1.0, >= 1.0.5)
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.4)
  activesupport (= 4.2.4)
  globalid (>= 0.3.0)
activemodel (4.2.4)
  activesupport (= 4.2.4)
  builder (~> 3.1)
activerecord (4.2.4)
  activemodel (= 4.2.4)
  activesupport (= 4.2.4)
  arel (~> 6.0)
activesupport (4.2.4)
  i18n (~> 0.7)
  json (~> 1.7, >= 1.7.7)
  minitest (~> 5.1)
  thread_safe (~> 0.3, >= 0.3.4)
  tzinfo (~> 1.1)
arel (6.0.3)
bcrypt (3.1.10)
binding_of_caller (0.7.2)
  debug_inspector (>= 0.0.1)
builder (3.2.2)
byebug (6.0.2)
coffee-rails (4.1.0)
  coffee-script (>= 2.2.0)
  railties (>= 4.0.0, < 5.0)
coffee-script (2.4.1)
  coffee-script-source
  execjs
coffee-script-source (1.9.1.1)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.6.0)
faraday (0.9.1)
  multipart-post (>= 1.2, < 3)
globalid (0.3.6)
  activesupport (>= 4.1.0)
i18n (0.7.0)
jbuilder (2.3.1)
  activesupport (>= 3.0.0, < 5)
  multi_json (~> 1.2)
jquery-rails (4.0.5)
  rails-dom-testing (~> 1.0)
  railties (>= 4.2.0)
  thor (>= 0.14, < 2.0)
json (1.8.3)
jwt (1.5.1)
loofah (2.0.3)
  nokogiri (>= 1.5.9)
mail (2.6.3)
  mime-types (>= 1.16, < 3)
mime-types (2.6.2)
mini_portile (0.6.2)
minitest (5.8.1)
multi_json (1.11.2)
multi_xml (0.5.5)
multipart-post (2.0.0)
nokogiri (1.6.6.2)
  mini_portile (~> 0.6.0)
oauth (0.4.7)
oauth2 (1.0.0)
  faraday (>= 0.8, < 0.10)
  jwt (~> 1.0)
  multi_json (~> 1.3)
  multi_xml (~> 0.5)
  rack (~> 1.2)
pg (0.18.3)
rack (1.6.4)
rack-test (0.6.3)
  rack (>= 1.0)
rails (4.2.4)
  actionmailer (= 4.2.4)
  actionpack (= 4.2.4)
  actionview (= 4.2.4)
  activejob (= 4.2.4)
  activemodel (= 4.2.4)
  activerecord (= 4.2.4)
  activesupport (= 4.2.4)
  bundler (>= 1.3.0, < 2.0)
  railties (= 4.2.4)
  sprockets-rails
rails-deprecated_sanitizer (1.0.3)
  activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
  activesupport (>= 4.2.0.beta, < 5.0)
  nokogiri (~> 1.6.0)
  rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
  loofah (~> 2.0)
railties (4.2.4)
  actionpack (= 4.2.4)
  activesupport (= 4.2.4)
  rake (>= 0.8.7)
  thor (>= 0.18.1, < 2.0)
rake (10.4.2)
rdoc (4.2.0)
sass (3.4.18)
sass-rails (5.0.4)
  railties (>= 4.0.0, < 5.0)
  sass (~> 3.1)
  sprockets (>= 2.8, < 4.0)
  sprockets-rails (>= 2.0, < 4.0)
  tilt (>= 1.1, < 3)
sdoc (0.4.1)
  json (~> 1.7, >= 1.7.7)
  rdoc (~> 4.0)
sorcery (0.9.1)
  bcrypt (~> 3.1)
  oauth (~> 0.4, >= 0.4.4)
  oauth2 (>= 0.8.0)
spring (1.4.0)
sprockets (3.3.4)
  rack (~> 1.0)
sprockets-rails (2.3.3)
  actionpack (>= 3.0)
  activesupport (>= 3.0)
  sprockets (>= 2.8, < 4.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.1)
turbolinks (2.5.3)
  coffee-rails
tzinfo (1.2.2)
  thread_safe (~> 0.1)
uglifier (2.7.2)
  execjs (>= 0.3.0)
  json (>= 1.8.0)
web-console (2.2.1)
  activemodel (>= 4.0)
  binding_of_caller (>= 0.7.2)
  railties (>= 4.0)
  sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
 ruby

 DEPENDENCIES
byebug
coffee-rails (~> 4.1.0)
jbuilder (~> 2.0)
jquery-rails
pg
rails (= 4.2.4)
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
sorcery (= 0.9.1)
spring
turbolinks
uglifier (>= 1.3.0)
 web-console (~> 2.0)

BUNDLED WITH
1.10.6

Help would be much appreciated!

Upvotes: 0

Views: 561

Answers (2)

luke
luke

Reputation: 1578

Figured it out. I had two versions of rails installed. Uninstalled both of them and railties as well. Reinstalled rails 4.2.4 and everything is working now.

Upvotes: 1

The Ancient
The Ancient

Reputation: 380

You haven't published your Gemfile and Gemfile.lock, so I can only make assumptions. I assume that your Gemfile.lock contains a reference to rails 4.2.4, correct? If yes, make sure that you start rails from the directory where it resides; since Rails 3 it is Bundler-aware, so it executes rails command in the context of the current bundle.

Upvotes: 1

Related Questions