Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails bundles downgrade

I am working on ROR and incidentally I upgraded my bundles with bundle update command, I got message that bundles are up to date, but when am trying to start my rails server rails s it is throwing me an error:

/var/lib/gems/1.9.1/gems/devise-3.2.4/lib/devise/models.rb:88:in `const_get': uninitialized constant Devise::Models::TokenAuthenticatable (NameError)

Please tell me what I have to do to solve this. I have done lots of R&D on this, but not get any answer. I installed rails with sudo apt-get install rails not RVM. I think there is an option to downgrade rails version with RVM.
please help.

like image 578
Shiv Aggarwal Avatar asked Apr 02 '14 04:04

Shiv Aggarwal


1 Answers

As per this link:

TokenAuthenticatable has been removed from Devise. So if you are using it in your application, you'll need to remove it.

devise :database_authenticatable, :registerable,
 -         :recoverable, :rememberable, :token_authenticatable

:token_authenticatable should be removed.

Refer this link also.

If it works locally it likely means an old gem is being loaded - make sure your gems do not include an old version of devise and in your Gemfile please specify gem 'devise' only without the version specifically.

Then, for downgrading ruby version, you need to install RVM in your machine,

Please refer the below links to install RVM and different versions of ruby using it. Then, you can use appropriate ruby versions for different projects. No need to downgrade the system installed ruby version. Also, you can use system ruby version if you need. (rvm use system)

http://rvm.io/rvm/install

https://rvm.io/rubies/installing

http://rvm.io/rvm/basics

Hope it helps :)

like image 79
Rajesh Omanakuttan Avatar answered Oct 09 '22 01:10

Rajesh Omanakuttan