在运行时brew install mongodb,我得到以下输出:
Updating Homebrew...
mongodb: A full installation of Xcode.app 8.3.2 is required to compile this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.
Run Code Online (Sandbox Code Playgroud)
我的系统在OSX El Capitan版本10.11.6上运行.
无论如何安装mongodb而不将其升级到Mac OS Sierra和Xcode 8.3.3?
我是 Rails 新手,我已经开始使用“Devise” gem 在示例 Rails 应用程序中构建身份验证功能。
我添加了一个迁移,以在名为User 的设计模型中添加一个名为username的新列。
我还添加了一些关于我创建的用户名列的验证,因此我的 user.rb 如下所示:
Run Code Online (Sandbox Code Playgroud)class User < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable validates_presence_of :username validates_uniqueness_of :username validates_length_of :username, :minimum => 5, :maximum => 10 end
现在,每次在新用户注册期间,我都会得到用户名验证,尽管它不应该得到验证。
例如,它告诉我即使用户名已填写,用户名也不应该为空。
用户名至少应包含 5 个字符,尽管如此。
我究竟做错了什么?在控制台中,我可以看到在表单提交期间在参数中传递的用户名以及:Unpermissed argument :username。
其次,我想使用相同的电子邮件地址但不同的用户名创建多个注册。
我怎样才能做到这一点?
我正在使用 ruby 2.4.1 和 Rails 5.1.4。谢谢。