尝试生成设计时出错:在Ruby on Rails中安装 [英] Error when trying to generate devise:install in Ruby on Rails

查看:79
本文介绍了尝试生成设计时出错:在Ruby on Rails中安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ruby on Rails的新手,我试着从Internet上做一些例子。但是当我尝试生成设计安装时出现错误。
我通过添加 gem devise 修改了Gemfile。然后运行:

 捆绑安装

但是当我运行时。

  rails生成设备:安装

我有下一个错误:

  /usr/local/lib/ruby/gems/0.9.1/gems/devise-1.1.3/lib/devise.rb:193:in`mailer =':未定义的方法`ref'用于ActiveSupport :: Dependencies:Module (NoMethodError)$ / $ b / from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib/devise.rb:195:in`< module:Devise>'$ b $ from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib/devise.rb:4:in`< top(required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in`require'$ b $ from / usr / local / lib / ruby /gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in`block(2 levels)in require'
from / usr / local / lib / ruby​​ / gems /1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in /usr/local/lib/ruby/gems/1.9.1中的每个'
' /gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in`block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3 .5 / lib / bundler / runtime.rb:59:来自/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime的`each'
.rb:59:在'require'中
从/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in'require'$ b / b from /home/mihai/Desktop/blog/config/application.rb:7:in`< top(required)>'
from /usr/local/lib/ruby/gems/1.9。 1 / gems / railties-3.2.13 / lib / rails / commands.rb:24:在'require'中
来自/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2。 13 / lib / rails / commands.rb:24:在< top(required)>'脚本/ rails中
:6:在'require'
脚本/ rails中:6:in `< main>'

请帮助我!

解决方案

Devise的版本比较陈旧。

您可以这样做:

 包更新de vise 

然后:

  bundle install 

这应该升级Devise gem。


I'm a new to Ruby on Rails and I tried to do some examples from Internet. But I have an error when I'm trying to generate devise install. I modified the Gemfile by adding gem devise. Then run:

bundle install

but when I run.

rails generate devise:install

I had the next error:

/usr/local/lib/ruby/gems/0.9.1/gems/devise-1.1.3/lib/devise.rb:193:in `mailer=': undefined method `ref' for ActiveSupport::Dependencies:Module (NoMethodError)
    from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib/devise.rb:195:in `<module:Devise>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib/devise.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /home/mihai/Desktop/blog/config/application.rb:7:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:24:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:24:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Please help me!

解决方案

The version of Devise is rather old.

You can do:

bundle update devise

And then:

bundle install

This should upgrade the Devise gem.

这篇关于尝试生成设计时出错:在Ruby on Rails中安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆