Asgeir
Asgeir

Reputation: 747

Running rails console suddenly stopped working

All of the sudden, Rails' console stopped working on one of my projects. I keep getting the following error:

rails c
Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
Could not find activesupport-4.1.4 in any of the sources
Run `bundle install` to install missing gems.

So I updated Rubygems, with the following two lines (from rubygems.com)

$ gem install rubygems-update  # again, might need to be admin/root
$ update_rubygems  

and get the following output:

Successfully installed rubygems-update-2.4.4
Parsing documentation for rubygems-update-2.4.4
Done installing documentation for rubygems-update after 0 seconds
1 gem installed

...

RubyGems 2.4.4 installed
Parsing documentation for rubygems-2.4.4
Installing ri documentation for rubygems-2.4.4
=== 2.4.4 / 2014-11-12

Aaaaaand, then I run rails console again, and just get the same error message again.

Thoughts?

Upvotes: 0

Views: 1035

Answers (3)

AME
AME

Reputation: 2302

This might be the problem only if you use rvm else just ignore it.

Navigate to the root path (where your rails app is located).

type in your command line;

rvm list

You will get something like:

rvm rubies

   jruby-1.7.11 [ x86_64 ]
   ruby-2.0.0-p247 [ x86_64 ]
=* ruby-2.0.0-p451 [ x86_64 ]
   ruby-2.1.0 [ x86_64 ]
   ruby-2.1.1 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

If your default is not the current you have most likely changed it. Try to change it back and run:

You can change it like so:

rvm use ruby-2.0.0-p451

When you get the right version you can make it permanent.

like so:

rvm --default use ruby-2.0.0-p451

bundle install 

again.

Upvotes: 1

the Tin Man
the Tin Man

Reputation: 160553

The message also says to run gem pristine --all which will reinstall all the gems from the cache and recompile all native drivers in the gems.

Updating the Rubygems code doesn't do this so you have to explicitly run the command.

Upvotes: 0

aspencer8111
aspencer8111

Reputation: 786

Just a shot in the dark, but maybe try:

gem install activesupport -v 4.1.4

Then try and run rails c again.

Upvotes: 0

Related Questions