I was able to work around this by making the following change to
script/create_admin:

From:

user = User.new :password => password, :password_confirmation =>
password, :email => email, :terms_of_use => '1'
user.login = 'admin'
user.is_admin = true

To:

user = User.new :email => email, :terms_of_use => '1'
user.login = 'admin'
user.is_admin = true
user.password = password
user.password_confirmation = password

Seems to stem from the fact the password and password_confirm are
"protected" ActiveRecord properties.

I'll try to submit a patch once I get a bit more comfortable with
Gitorious and Ruby in general.

Hope this helps...

Regards,
Mike

On Jun 18, 7:40 am, Russell Greenwald
<rgreenw...@insourceservices.com> wrote:
> I'm having issues creating the admin user, I added a "!" to user.save
> for debugging.  The error is below.  I'm using strong passwords, but
> no luck, any advice?
>
> Error Message
>
> /home/git/gitorious/vendor/rails/activerecord/lib/active_record/
> validations.rb:1090:in `save_without_dirty!': Validation failed:
> Password can't be blank, Password is too short (minimum is 4
> characters), Password doesn't match confirmation
> (ActiveRecord::RecordInvalid)
>
> Here is the "create_admin" script
>
> #!/usr/bin/env ruby
> require File.dirname(__FILE__)+'/../config/environment'
> ActionMailer::Base.raise_delivery_errors = false
> ActionMailer::Base.delivery_method = :test
>
> if User.find_by_is_admin(true)
>   puts "You already have an Administrator"
>   exit!
> end
>
> puts "Type in Administrator's e-mail: "
> email = gets.strip
> puts "Type in Administrator's password: "
> password = gets.strip
>
> user = User.new :password => password, :password_confirmation =>
> password, :email => email, :terms_of_use => '1'
> user.login = 'admin'
> user.is_admin = true
> if user.save!
>   user.activate
>   puts "Admin user created successfully."
> else
>   puts "Failed creating Admin user."
> end

-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

Reply via email to