Skip to content

bundle install ask for password when build #138

Closed
txworking opened this Issue Mar 29, 2013 · 4 comments

4 participants

@txworking

i create a project and let the build scripts as bundle install
but when project build it ask for password, this is error message:

 cd /home/gitlab_ci/test_project && git fetch && git reset --hard && git checkout bb75694602ee1d35837ed388a3b9e6db88cc4c98
HEAD is now at bb75694 add erb templates
HEAD is now at bb75694... add erb templates

bundle install
Fetching source index from http://ruby.taobao.org/
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts

Gem::Exception: Cannot load gem at [/usr/local/lib/ruby/gems/1.9.1/cache/bosh_common-0.5.4.gem] in /home/gitlab_ci/test_project
An error occurred while installing bosh_common (0.5.4), and Bundler cannot
continue.
Make sure that `gem install bosh_common -v '0.5.4'` succeeds before bundling.

i use putty to login the server and run

sudo -u gitlab_ci -H bundle install

it still ask for password.
but run like this

sudo su gitlab_ci
bundle install

gems successful install

and i find run sudo -u gitlab_ci -H rvm current get this message

sudo: rvm: command not found

but these commands

sudo su gitlab_ci
rvm current

will print current ruby version

i have add source /home/gitlab_ci/.rvm/scripts/rvm into /home/gitlab_ci/.rvmrc

any help would be appreciated

@Telmo
Telmo commented Apr 6, 2013

bundle install --deployment

@txworking

@Telmo thanks for reply
i reinstall gitlab_ci and didn't follow the install rvm section of the documention.
here was my steps:

  • use \curl -L https://get.rvm.io | sudo bash -s stable --ruby to install rvm for multiusers. this will add rvm.sh in /etc/profile.d dircetory.
  • add gitlab_ci to rvm group
  • use rvmsudo su gitlab_ci instead of sudo su gitlab_ci in all following commands

and it resolved the problem.
so i think this is a bash environment problem.

@brodock
brodock commented May 20, 2013

@txworking I have also needed to create a rule on /etc/sudoers to not ask for passwords:

gitlab_ci ALL=NOPASSWD: ALL
(in fact I've placed it as a new file 'gitlab_ci' at /etc/sudoers.d on ubuntu)

@Razer6
GitLab member
Razer6 commented Jun 23, 2013

I'm closing this one for now. Report back in case of errors.

@Razer6 Razer6 closed this Jun 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.