2014-07-22 27 views
7

试图安装设计,我得到以下消息“无法找到生成器设计:安装。”无法安装设计

[email protected]:~/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. 
[email protected]:~/Projects/dev01$ rails generate devise:install 
Could not find generator devise:install. 
[email protected]:~/Projects/dev01$ 

我的Gemfile是:

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的版本是:

[email protected]:~/Projects/dev01$ rails -v 
Rails 4.1.4 
[email protected]:~/Projects/dev01$ 

OS版本是:

[email protected]:~/Projects/dev01$ lsb_release -a 
No LSB modules are available. 
Distributor ID: Ubuntu 
Description: Ubuntu 14.04 LTS 
Release: 14.04 
Codename: trusty 
[email protected]:~/Projects/dev01$ 

任何想法,为什么制定宝石赢得”在正确添加到Gemfile并运行后安装捆绑安装?

我确实有服务器在一个点(轨道服务器)上运行,看到了一篇文章,指出尝试安装设计,同时服务器启动可能会导致奇怪的问题。

我因为与服务器下来,但没有差别再次尝试。我确信这可能是由于我在设置中忽略了一些非常简单的事情而发生的,只是不确定在哪里寻找。

在哪里下一看任何建议或建议将是巨大的,谢谢。

我已经做使用下面的命令测试,但仍然收到了同样的错误:

[email protected]:~/Projects/dev01$ bundle exec rails g devise:install 
Could not find generator devise:install. 

安装发电机的下方,并没有列出制定的名单,我怎么把它上市?

[email protected]:~/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 

[email protected]:~/Projects/dev01$ 
+0

如果你输入'rails generate'你会看到设计选项吗? – JTG

+0

您正在使用RVM或任何其他版本管理器。您可以将Devise gem安装在与您期望的不同的gemset上。 – sergserg

+0

不,运行轨道生成不会列出设计 – shwashbuckle

回答

3

OK,我仍然不是100%肯定,为什么这个工作或者是什么摆在首位,但运行以下命令后引起的问题:

[email protected]:~/Projects/dev01$ gem uninstall devise 
Successfully uninstalled devise-3.2.4 
[email protected]:~/Projects/dev01$ gem uninstall warden 
Successfully uninstalled warden-1.2.3 
[email protected]:~/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. 
[email protected]:~/Projects/dev01$ rails generate devise:install 
     create config/initializers/devise.rb 
     create config/locales/devise.en.yml 

宇豪!问题解决了。通过添加以下行到我的Gemfile浪费:-(

+0

我试过了,它仍然没有为我工作>。< –

2

这似乎在我的机器上在RVM下工作,但这是一个新的gemset。如果您正在使用与其他Rails安装共享的Ruby版本(或RVM gemset),那么您可能会遇到问题。

当你使用捆扎机,你应该使用:

bundle exec rails g devise:install 

作为一般的预防措施,以确保您使用的是包的宝石。

+0

嗨@AFaderDarkly,我试过这个命令,并更新了我上面的原始文章的结果。 – shwashbuckle

+0

我从其他评论中看到你正在使用rbenv。我是一名rvm用户,不幸的是我没有任何rbenv经验。然而,有一点需要注意,可能是您使用的'rails'命令的位置以及您正在使用的ruby版本的ruby gems的位置。如果它们不匹配,另一个ruby版本的rails命令可能会覆盖你想要的那个。另一件事要检查(看rbenv文档)是为了确保〜/ .rbenv/shims在你的路径的开始。 (在〜/ .bashrc或〜/ .bash_profile中查看,如果你在Linux或带有bash shell的OSX上) –

+0

Thanks Fader,检查了以下内容,两条路径都匹配,我改变了路径,以便垫片路径在开始但仍然没有喜悦:-( 利@雷 - VirtualBox的:〜/项目/ DEV01 $ rbenv --version rbenv 0.4.0-98-g13a474c 利@雷 - VirtualBox的:〜/项目/ DEV01 $其中轨道 /home/leigh/.rbenv/shims/rails leigh @ leigh-VirtualBox:〜/ Projects/dev01 $ which ruby​​ /home/leigh/.rbenv/shims/ruby – shwashbuckle

1

我修好了几天的好方法:

gem 'devise' 

加入该行后,我执行bundle install

1

我有今天同样的问题。我试图卸载devisewarden但没有运气。最后,我删除了Gemfile.lock,并再次运行bundle install和做的伎俩。

+0

感谢这一个工作! – 0bserver07

2

什么工作对我来说是

sudo -s 
bundle exec rails generate devise:install 

没有sudo或运行“初始化” /bin/bash --login没有工作,其他的解决方案可能是除去Gemfile.lock的,然后再次运行bundle install

希望它有效。

4

今天同样的问题,我从Gemfile中删除了'spring',它的确有窍门。 或者你可以先关闭你的弹簧然后运行导轨生成设计:安装