无法安装Devise [英] Can't install Devise

查看:133
本文介绍了无法安装Devise的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试安装Devise,并收到以下消息无法找到生成器设计:安装。

  leigh @ leigh -VirtualBox:〜/ Projects / dev01 $ bundle install 
使用rake 10.3.2
使用i18n 0.6.11
使用json 1.8.1
使用minitest 5.4.0
使用thread_safe 0.3.4
使用tzinfo 1.2.1
使用activesupport 4.1.4
使用builder 3.2.2
使用erubis 2.7.0
使用actionview 4.1。 4
使用机架1.5.2
使用机架测试0.6.2
使用actionpack 4.1.4
使用mime类型1.25.1
使用polyglot 0.3.5
使用treetop 1.4.15
使用邮件2.5.4
使用actionmailer 4.1.4
使用activemodel 4.1.4
使用arel 5.0.1.20140414130214
使用activerecord 4.1.4
使用execjs 2.2.1
使用autoprefixer-rails 2.1.1.20140710
使用bcrypt 3.1.7
使用sass 3.2.19
使用bootstrap-sass 3.2.0.0
使用thor 0.19.1
使用轨道4.1.4
使用bootswatch-rails 3.2.0
使用咖啡ript-source 1.7.1
使用咖啡脚本2.3.0
使用coffee-rails 4.0.1
使用git://github.com/的data-confirm-modal 1.0.1 ifad / data-confirm-modal.git(at master)
使用declarative_authorization 0.5.7
使用orm_adapter 0.5.0
使用warden 1.2.3
使用devise 3.2.4
使用远足1.2.3
使用multi_json 1.10.1
使用jbuilder 2.1.3
使用jquery-rails 3.1.1
使用bundler 1.6.4
使用倾斜1.4.1
使用链轮2.11.0
使用链轮轨道2.1.3
使用导轨4.1.4
使用rdoc 4.1.1
使用sass- rails 4.0.3
使用sdoc 0.4.0
使用弹簧1.1.3
使用sqlite3 1.3.9
使用turbolinks 2.2.2
使用uglifier 2.5.3
您的包完整!
使用`bundle show [gemname]`来查看捆绑的gem的安装位置。
leigh @ leigh-VirtualBox:〜/ Projects / dev01 $ rails generate devise:install
找不到生成器设计:安装。
leigh @ leigh-VirtualBox:〜/ Projects / dev01 $

我的Gemfile是: / p>

 源'https://rubygems.org'


# :gem'rails',github:'rails / rails'
gem'rails','4.1.4'
#使用sqlite3作为Active Record的数据库
gem'sqlite3'
#使用SCSS进行样式表
gem'sass-rails','〜> 4.0.3'
#使用Uglifier作为JavaScript资产的压缩器
gem'uglifier','> = 1.3.0'
#使用CoffeeScript for .js.coffee资产和视图
gem'coffee-rails','〜> 4.0.0'
#请参阅https://github.com/sstephenson/execjs#readme获取更多支持的运行时
#gem'therubyracer',平台::ruby

#使用jquery作为JavaScript库
gem'jquery-rails'
#Turbolinks使您的Web应用程序中的以下链接更快。阅读更多:https://github.com/rails/turbolinks
gem'turbolinks'
#轻松构建JSON API。阅读更多:https://github.com/rails/jbuilder
gem'jbuilder','〜> 2.0'
#bundle exec rake doc:rails在doc / api下生成API。
gem'sdoc','〜> 0.4.0',组::doc

#Spring通过保持应用程序在后台运行,加快开发速度。阅读更多:https://github.com/rails/spring
gem'spring',group::development

gem'bootstrap-sass','〜> 3.2.0.0'
gem'bootswatch-rails','〜> 3.2.0'

gem'autoprefixer-rails'

#使用数据确认模式创建自定义警报模态弹出窗口
gem'data-confirm-modal ',github:'ifad / data-confirm-modal'

#使用devise进行用户验证
gem'devise'
#使用declarative_authorization进行用户授权
gem 'declarative_authorization'

#使用ActiveModel has_secure_password
#gem'bcrypt','〜> 3.1.7'

#使用独角兽作为应用服务器
#gem'unicorn'

#使用Capistrano进行部署
#gem'capistrano- rails#,group::$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ / / / / / / / / / / / / / / / / / / / / / / / / / / / /]]]] pre>

Rails版本是:

  leigh @ leigh-VirtualBox: 〜/ Projects / dev01 $ rails -v 
Rails 4.1.4
leigh @ leigh-VirtualBox:〜/ Projects / dev01 $

操作系统版本是:

  leigh @ leigh-VirtualBox:〜/ Projects / dev01 $ lsb_release -a 
没有LSB模块可用。
分销商ID:Ubuntu
说明:Ubuntu 14.04 LTS
发行:14.04
代号:trusty
leigh @ leigh-VirtualBox:〜/ Projects / dev01 $

任何想法,为什么在正确添加到Gemfile并运行捆绑安装后,Devise宝石将无法安装?



我确实有服务器运行在一个点(rails服务器),并看到一篇文章说,尝试在服务器启动时安装Devise可能会导致奇怪的问题。 / p>

我已经尝试再次使用服务器,但没有区别。我确定这可能是因为一些非常简单的事情,我在设置中忽略了,只是不知道在哪里可以看。



任何关于哪里的建议或建议看看下一个会很棒,谢谢。



我已经使用以下命令进行了测试,但仍然收到相同的错误:

  leigh @ leigh-VirtualBox:〜/ Projects / dev01 $ bundle exec rails g devise:install 
找不到生成器设计:安装。

安装的生成器列表如下,Devise未列出,如何列出? / p>

  leigh @ leigh-VirtualBox:〜/ Projects / dev01 $ rails generate 
用法:rails generate GENERATOR [args] [选项]

常规选项:
-h,[--help]#打印生成器的选项和用法
-p,[--pretend]#运行但不要做任何更改
-f,[--force]#覆盖已存在的文件
-s,[--skip]#跳过已存在的文件
-q,[--quiet]#禁止状态输出

请在下面选择一个生成器。

Rails:
资产
控制器
生成器
帮助
integration_test
jbuilder
邮件
迁移
模型
资源
scaffold
scaffold_controller
任务

咖啡:
咖啡:资产

jquery:
jquery:install

Js:
js:assets

TestUnit:
test_unit:generator
test_unit:plugin

leigh @ leigh-VirtualBox:〜/ Projects / dev01 $


解决方案

好的,我仍然不能100%确定为什么这样工作,或者是首先导致了这个问题,但运行以下命令后:



$ pre> leigh @ leigh-VirtualBox:〜/ Projects / dev01 $ gem uninstall devise
成功卸载devise-3.2.4
leigh @ leigh-VirtualBox:〜/项目/ dev01 $ gem卸载warden
成功卸载warden-1.2.3
leigh @ leigh-VirtualBox:〜/ Projects / dev01 $ bundle install
获取gem metada ta从https://rubygems.org / .........
从https://rubygems.org/ ..中获取额外的元数据
[...文本已删除... ]
安装warden 1.2.3
安装devise 3.2.4
[...文本删除...]
您的包完整!
使用`bundle show [gemname]`来查看捆绑的gem的安装位置。
leigh @ leigh-VirtualBox:〜/ Projects / dev01 $ rails generate devise:install
create config / initializers / devise.rb
create config / locales / devise.en.yml

Woo Hoo !!!问题解决了。浪费几天的好方法: - (


Trying to install Devise and I get the following message "Could not find generator devise:install."

leigh@leigh-VirtualBox:~/Projects/dev01$ bundle install
Using rake 10.3.2
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.4.0
Using thread_safe 0.3.4
Using tzinfo 1.2.1
Using activesupport 4.1.4
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.4
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.4
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.4
Using activemodel 4.1.4
Using arel 5.0.1.20140414130214
Using activerecord 4.1.4
Using execjs 2.2.1
Using autoprefixer-rails 2.1.1.20140710
Using bcrypt 3.1.7
Using sass 3.2.19
Using bootstrap-sass 3.2.0.0
Using thor 0.19.1
Using railties 4.1.4
Using bootswatch-rails 3.2.0
Using coffee-script-source 1.7.1
Using coffee-script 2.3.0
Using coffee-rails 4.0.1
Using data-confirm-modal 1.0.1 from git://github.com/ifad/data-confirm-modal.git (at master)
Using declarative_authorization 0.5.7
Using orm_adapter 0.5.0
Using warden 1.2.3
Using devise 3.2.4
Using hike 1.2.3
Using multi_json 1.10.1
Using jbuilder 2.1.3
Using jquery-rails 3.1.1
Using bundler 1.6.4
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.1.3
Using rails 4.1.4
Using rdoc 4.1.1
Using sass-rails 4.0.3
Using sdoc 0.4.0
Using spring 1.1.3
Using sqlite3 1.3.9
Using turbolinks 2.2.2
Using uglifier 2.5.3
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
leigh@leigh-VirtualBox:~/Projects/dev01$ rails generate devise:install
Could not find generator devise:install.
leigh@leigh-VirtualBox:~/Projects/dev01$ 

My Gemfile is:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

gem 'bootstrap-sass', '~> 3.2.0.0'
gem 'bootswatch-rails', '~> 3.2.0'

gem 'autoprefixer-rails'

# Use data-confirm-modal to create custom alert modal popups
gem 'data-confirm-modal', github: 'ifad/data-confirm-modal'

# Use devise for user authentication
gem 'devise'
# Use declarative_authorization for user authorisation
gem 'declarative_authorization'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

Rails version is:

leigh@leigh-VirtualBox:~/Projects/dev01$ rails -v
Rails 4.1.4
leigh@leigh-VirtualBox:~/Projects/dev01$ 

OS version is:

leigh@leigh-VirtualBox:~/Projects/dev01$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:    14.04
Codename:   trusty
leigh@leigh-VirtualBox:~/Projects/dev01$ 

Any ideas as to why the Devise gem won't install after correctly adding it to the Gemfile and running the bundle install?

I did have the server running at one point (rails server) and saw an article stating that attempting to install Devise whilst the server is up could cause strange issues.

I've since tried again with the server down but no difference. I'm sure this is probably happening due to something really simple that I overlooked in the setup, just not sure where else to look.

Any advise or suggestions on where to look next would be great, thanks.

I've done testing using the command below but still received the same error:

leigh@leigh-VirtualBox:~/Projects/dev01$ bundle exec rails g devise:install
Could not find generator devise:install.

The list of installed generators are below and Devise is not listed, how do I get it listed?

leigh@leigh-VirtualBox:~/Projects/dev01$ rails generate
Usage: rails generate GENERATOR [args] [options]

General options:
  -h, [--help]     # Print generator's options and usage
  -p, [--pretend]  # Run but do not make any changes
  -f, [--force]    # Overwrite files that already exist
  -s, [--skip]     # Skip files that already exist
  -q, [--quiet]    # Suppress status output

Please choose a generator below.

Rails:
  assets
  controller
  generator
  helper
  integration_test
  jbuilder
  mailer
  migration
  model
  resource
  scaffold
  scaffold_controller
  task

Coffee:
  coffee:assets

Jquery:
  jquery:install

Js:
  js:assets

TestUnit:
  test_unit:generator
  test_unit:plugin

leigh@leigh-VirtualBox:~/Projects/dev01$

解决方案

OK, I'm still not 100% sure why this worked or what caused the issue in the first place but after running the following commands:

leigh@leigh-VirtualBox:~/Projects/dev01$ gem uninstall devise
Successfully uninstalled devise-3.2.4
leigh@leigh-VirtualBox:~/Projects/dev01$ gem uninstall warden
Successfully uninstalled warden-1.2.3
leigh@leigh-VirtualBox:~/Projects/dev01$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
[... text removed ...]
Installing warden 1.2.3
Installing devise 3.2.4
[... text removed ...]
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
leigh@leigh-VirtualBox:~/Projects/dev01$ rails generate devise:install
      create  config/initializers/devise.rb
      create  config/locales/devise.en.yml

Woo Hoo!!! problem solved. Great way to waste a couple of days :-(

这篇关于无法安装Devise的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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