简体   繁体   English

Ruby on Rails捆绑降级

[英]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: 我正在研究ROR,顺便说一下,我使用bundle update命令升级了我的bundle,我收到了捆绑包是最新的消息,但是当我试图启动我的rails服务器rails s它会给我一个错误:

/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. 我用sudo apt-get install rails而不是RVM sudo apt-get install rails I think there is an option to downgrade rails version with RVM. 我认为可以选择使用RVM降级rails版本。
please help. 请帮忙。

As per this link : 根据这个链接

TokenAuthenticatable has been removed from Devise. TokenAuthenticatable已从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. :token_authenticatable应删除:token_authenticatable

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. 如果它在本地工作,它可能意味着正在加载一个旧的gem - 确保你的宝石不包含旧版本的设计,并且在你的Gemfile中请指定gem'devise gem 'devise'而不是特定版本。

Then, for downgrading ruby version, you need to install RVM in your machine, 然后,为了降级ruby版本,你需要在你的机器上安装RVM,

Please refer the below links to install RVM and different versions of ruby using it. 请参考以下链接,使用它安装RVM和不同版本的ruby。 Then, you can use appropriate ruby versions for different projects. 然后,您可以为不同的项目使用适当的ruby版本。 No need to downgrade the system installed ruby version. 无需降级系统安装的ruby版本。 Also, you can use system ruby version if you need. 此外,如果需要,您可以使用系统ruby版本。 ( rvm use system ) rvm use system

http://rvm.io/rvm/install http://rvm.io/rvm/install

https://rvm.io/rubies/installing https://rvm.io/rubies/installing

http://rvm.io/rvm/basics http://rvm.io/rvm/basics

Hope it helps :) 希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM