我正在尝试设置将gem 'devise' , '1.1.2'
置于gemfile中并运行sudo bundle install
然后尝试运行rake --trace devise:setup
的设计。然后出现错误,有人知道我的Rails 3应用程序有什么问题吗?
(in /home/wizztjh/work/testing123)
rake aborted!
Don't know how to build task 'devise:setup'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in `[]'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/var/lib/gems/1.8/bin/rake:19:in `load'
/var/lib/gems/1.8/bin/rake:19
答案 0 :(得分:6)
我认为主要问题是您没有使用适当的方式来安装设备。以下是devise documentation:
的正确生成器#this installs the devise initializer which is needed to run devise in r3.
rails generate devise:install
#this generates your model as a devise resource
rails generate devise [MODEL_NAME]
#this copies all the view files into your local app for modifications
rails generate devise:views