- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我在我的 Rails 4 应用程序中使用了 devise 和 omniauth。我从这个页面(从答案)做了所有的 Action :
Devise, Omniauth and Facebook integration session error
将此 :omniauthable 添加到后这个字符串
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable
,我收到错误:
/home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:193:in `normalize_conditions!': You should not use the `match` method in your router without specifying an HTTP method. (RuntimeError)
If you want to expose your action to GET, use `get` in the router:
Instead of: match "controller#action"
Do: get "controller#action"
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:64:in `initialize'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1425:in `new'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1425:in `add_route'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1404:in `decomposed_match'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1386:in `block in match'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1386:in `each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1386:in `match'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:365:in `devise_omniauth_callback'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:212:in `block (4 levels) in devise_for'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:212:in `each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:212:in `block (3 levels) in devise_for'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:376:in `with_devise_exclusive_scope'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:211:in `block (2 levels) in devise_for'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:311:in `block in devise_scope'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:833:in `block in constraints'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:716:in `scope'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:833:in `constraints'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:310:in `devise_scope'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:209:in `block in devise_for'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:192:in `each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:192:in `devise_for'
from /home/u164/nikita/projects/domain-inspect/config/routes.rb:2:in `block in <top (required)>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/route_set.rb:320:in `instance_exec'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/route_set.rb:320:in `eval_block'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/route_set.rb:298:in `draw'
from /home/u164/nikita/projects/domain-inspect/config/routes.rb:1:in `<top (required)>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `load'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `block in load'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `load'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/file_update_checker.rb:75:in `call'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:30:in `run'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:180:in `each'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application.rb:213:in `initialize!'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/u164/nikita/projects/domain-inspect/config/environment.rb:5:in `<top (required)>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `require'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `block in require'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `require'
from /home/u164/nikita/projects/domain-inspect/config.ru:3:in `block in <main>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/u164/nikita/projects/domain-inspect/config.ru:in `new'
from /home/u164/nikita/projects/domain-inspect/config.ru:in `<main>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands/server.rb:46:in `app'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands/server.rb:71:in `start'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands.rb:78:in `block in <top (required)>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `tap'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
我该怎么办?或者现在有在 rail 4 应用程序中使用设计的方法吗?
UPD 1
这是我的 routes.rb
DomainInspect::Application.routes.draw do
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" ,:registrations => "registrations" }
root :to => 'pages#main'
resources :users, only: [:show, :edit, :update]
resources :domains
end
最佳答案
最新版本的设计 ( v2.2.3 as of this writing) 当前不支持 Rails 4。但是目前有 an active pull request open.
因此,在它被合并并发布到野外之前,您可以指向您的 Gemfile
以将其与以下内容一起使用:
gem 'devise', :github => 'plataformatec/devise', :branch => 'rails4'
关于ruby-on-rails - rails 4 : devise and omniauthable error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16184974/
我已将 Devise 设置为允许使用电子邮件或用户名登录。使用您的用户名,您可以拥有一个个性网址,如下所示:vanity.com/username。因此,我的用户模型具有 attr_accessibl
我有个类似的问题。我正在使用sendmail选项,并继续出现错误 “发送邮件需要使用SMTP发件人地址。设置邮件 smtp_envelope_from,return_path,发件人或地址。” 我已经
我在为我的用户表做种子时遇到问题。 (rails 3.2.6,jruby 1.6.7.2,devise 2.1.2) 这是一个非常通用的用户表,由“rails generate devise User
我为公司设计了一个设计。我做了一个表用户,希望我想存储用户信息密码等。当用户注册时,我希望它创建一个新用户和公司的关联。 我的公司模型:has_one:用户我的用户模型:Belongs_to: 公司
我目前正在从我们的应用程序中删除 IP 日志记录,我想知道使用 Devise 执行此操作的最佳方法是什么? 最佳答案 你的答案看起来不错,但如果你只想跟踪特定用户的 IP,一个(不那么冗长但可能更令人
我有一个包含 Devise (2.2.3) 和 Active Admin (0.5.1) 的应用程序,我先安装了 Devise,然后安装了 Active Admin。整个应用程序需要登录,所以在我的应
我有一个包含 Devise (2.2.3) 和 Active Admin (0.5.1) 的应用程序,我先安装了 Devise,然后安装了 Active Admin。整个应用程序需要登录,所以在我的应
我在 API 模式下使用 Rails,使用 Devise 和 Devise JWT(用于 API)和 ActiveAdmin。我一切正常,但我一直在构建 API Controller ,现在 Acti
在使用 Devise TestHelpers 的文档中,它声明使用诸如... @request.env["devise.mapping"] = Devise.mappings[:admin] 或者 @
许多程序员使用 devise 作为他们的身份验证解决方案,我想听听他们的建议: Devise 已经过测试,但我想知道是否有我自己要测试的东西(集成/单元/功能测试?),以根据我的知识进行标准设计集成(
我正在尝试通过 JSON 注册设备用户,但一直收到 ActiveModel::ForbiddenAttributesError class Api::V1::RegistrationsControll
我正在使用 Rails 4.0.2 和 Devise 3.2.2 来处理用户注册/身份验证。 我已经用谷歌搜索并在 stackoverflow 上搜索答案,但找不到可以回答我的问题的东西。 下面的代码
我正在使用 ruby 2.2.3 和 rails 4.2.5。我无法在我的项目上运行 rails generate devise:install。 Bundler 抛出错误。错误如下 rails
我正在使用设计和 devise-basecamper用于使用我的基于子域的 Web 应用程序进行身份验证。 我想允许 super 用户访问任何帐户(基本上是任何子域)。 我不确定我将如何实现这一点,以
我正在为我的应用程序实现设计邮件程序,我已完成以下步骤: 在模型中: class User "smtp.gmail.com", :port => 587, :domain =
我在 SO 上找到了类似的线程,但没有一个帮助我解决了这个问题。我的路线如下: devise_for :users do post '/users' => 'registrations#cre
编辑 2:看起来对我来说一个快速的临时修复是在我的 link_to_unless_current 和 current_page 方法中的 Controller 名称前面添加一个正斜杠“/”。例如 '
由于无法控制的原因,我无法在当前项目中使用RSpec进行测试。我正在尝试测试“设计重置密码”,但似乎无法提出有用的建议。 这是我到目前为止的内容: require 'test_helper' clas
我有一个问题,一开始看起来并不难,但实际上我无法解决。我正在尝试将 Refinery 用作应用程序的 CMS。我想将 Refinery 用户和其他类型的用户分开,称他们为 mktgeistusers,
我想自定义以下由devise提供的flash msg 在 devise.en.yml 文件中: devise: failure: unconfirmed: 'You have to
我是一名优秀的程序员,十分优秀!