简体   繁体   English

为Ruby on Rails设计gem install

[英]devise gem install for Ruby on Rails

just started learning Ruby on Rails, I'm trying to install the devise gem for creating a login/signin lesson, but I keep getting the following messages.. 刚开始学习Ruby on Rails时,我正在尝试安装devise gem来创建登录/登录课程,但是我不断收到以下消息。

Could anyone help please? 有人可以帮忙吗? and feel free to correct me on how i'm asking the questions. 并随时根据我的提问方式对我进行纠正。 New to this community and would love to be involved. 这个社区的新手,很乐意参与其中。

alexs-air:pinteresting alexkwon$ rails generate devise:install
/Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activerecord-4.1.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `devise' for Install (call 'Install.connection' to establish a connection):Class (NoMethodError)
    from /Users/alexkwon/Desktop/pinteresting/app/models/install.rb:4:in `<class:Install>'
    from /Users/alexkwon/Desktop/pinteresting/app/models/install.rb:1:in `<top (required)>'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:443:in `load'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:443:in `block in load_file'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:633:in `new_constants_in'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:442:in `load_file'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:342:in `require_or_load'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:480:in `load_missing_constant'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:180:in `const_missing'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:238:in `const_get'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:238:in `block in constantize'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `each'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `inject'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `constantize'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:552:in `get'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:583:in `constantize'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise.rb:297:in `get'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise/mapping.rb:77:in `to'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise/mapping.rb:72:in `modules'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise/mapping.rb:89:in `routes'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise/mapping.rb:156:in `default_used_route'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise/mapping.rb:66:in `initialize'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise.rb:331:in `new'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise.rb:331:in `add_mapping'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise/rails/routes.rb:221:in `block in devise_for'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise/rails/routes.rb:220:in `each'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/lib/devise/rails/routes.rb:220:in `devise_for'
    from /Users/alexkwon/Desktop/pinteresting/config/routes.rb:2:in `block in <top (required)>'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:335:in `instance_exec'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:335:in `eval_block'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:313:in `draw'
    from /Users/alexkwon/Desktop/pinteresting/config/routes.rb:1:in `<top (required)>'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `block in load'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:40:in `each'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:16:in `reload!'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/file_update_checker.rb:75:in `call'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/file_update_checker.rb:75:in `execute'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:27:in `updater'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application/finisher.rb:71:in `block in <module:Finisher>'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /Users/alexkwon/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
    from /Users/alexkwon/Desktop/pinteresting/config/environment.rb:5:in `<top (required)>'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/application.rb:264:in `require_environment!'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:147:in `require_application_and_environment!'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:133:in `generate_or_destroy'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:51:in `generate'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /Users/alexkwon/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:8:in `require'
    from bin/rails:8:in `<main>'

Welcome to Rails man. 欢迎来到Rails的人。

I know the community is all up on the devise gem. 我知道整个社区都在设计这个宝石。 The reality is that Devise is an advanced authentication app that's a gem. 事实是,Devise是一个高级认证应用程序,它是一颗宝石。

If you're learning, and you need authentication, some super geek named Ryan Bates hooked you up with a tutorial and screencast on basic authentication that will work exactly how you need it, and you will understand what's going on: 如果您正在学习并且需要身份验证,那么一些名叫Ryan Bates的超级怪胎会为您提供一个教程和有关基本身份验证的截屏视频,该教程将完全满足您的需要,并且您将了解发生了什么:

http://railscasts.com/episodes/250-authentication-from-scratch http://railscasts.com/episodes/250-authentication-from-scratch

WHABAM! WHABAM!

Be mindful that is based on rails 3. Check the differences between rails, and ruby versions if you encounter problems while following directions. 请注意,它是基于导轨的。3.如果在遵循说明时遇到问题,请检查导轨和红宝石版本之间的差异。 If you do get errors, still, this path will get your further to deploying that app of yours. 即使您确实遇到错误,此路径仍将使您进一步部署自己的应用程序。

Come back to Devise when you need the features it provides, Rails, and confident you can implement ideas found in the book 'Crafting Rails Application' by José Valim. 当您需要Devise提供的功能,Rails时,请回到Devise,并确信您可以实施JoséValim撰写的“ Crafting Rails Application”一书中的想法。 He's one of the main contributors of Devise, so you'll get insight on his thought process. 他是Devise的主要贡献者之一,因此您将了解他的思考过程。

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

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