# Deprec + usermod invalid option -a

**URL:** <https://www.ruby-forum.com/t/deprec-usermod-invalid-option-a/108627>\
**Category:** Rails\
**Created:** [July 5, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/deprec-usermod-invalid-option-a/108627 "2007-07-05T14:33:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liberte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@liberte](https://www.ruby-forum.com/u/liberte)\
**Post date:** [July 5, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/deprec-usermod-invalid-option-a/108627/1 "2007-07-05T14:33:42Z")

</div>

Hi,

i currently try to setup an rails project with deprec  
([http://deprec.org](http://deprec.org)). i have executed the command “deprec --apply-to .”  
in my rails project directory and edited the condig/deploy.rb.

Then i have tried “cap install\_rails\_stack” and i got the following  
erros message:

> > command “sudo groups daniel | grep ’ deploy ’ || sudo /usr/sbin/usermod -G deploy -a daniel” failed on [www.host.com](http://www.host.com)

invalid option -a

know anybody what i could do ?

regards daniel

---

<div class="post-metadata">

**Author:** ![liberte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@liberte](https://www.ruby-forum.com/u/liberte)\
**Post date:** [July 5, 2007, 3:33pm UTC](https://www.ruby-forum.com/t/deprec-usermod-invalid-option-a/108627/2 "2007-07-05T15:33:07Z")

</div>

I have edited the file

–\>  
/deprec-1.9.0/lib/deprec/capistrano\_extension/deprec\_extensions.rb

i have removed the parenthesis from the expression “grep ‘#{group}’”  
and added the user ‘daniel’ manually to the group ‘deploy’.

`
  # add group to the list of groups this user belongs to
  def add_user_to_group(user, group)
    send(run_method, "groups #{user} | grep '#{group}' || sudo 
/usr/sbin/usermod -G #{group} -a #{user}")
  end
  `

this works for me.

regards daniel

---

<div class="post-metadata">

**Author:** ![liberte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@liberte](https://www.ruby-forum.com/u/liberte)\
**Post date:** [July 5, 2007, 3:38pm UTC](https://www.ruby-forum.com/t/deprec-usermod-invalid-option-a/108627/3 "2007-07-05T15:38:06Z")

</div>

i have removed the blanks from the expression “grep ’ #{group} '”

and added the user ‘daniel’ manually to the group ‘deploy’.
