Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start gitlab service. (CentOS 6.4) #121

Closed
mobdim opened this issue Sep 2, 2013 · 12 comments
Closed

Can't start gitlab service. (CentOS 6.4) #121

mobdim opened this issue Sep 2, 2013 · 12 comments

Comments

@mobdim
Copy link

mobdim commented Sep 2, 2013

I ran up to the step: https://github.com/gitlabhq/gitlab-recipes/tree/master/install/centos#start-your-gitlab-instance

Then:

service gitlab start
Starting unicorn:ERROR: RVM Ruby not used, run `rvm use ruby` first.
                                                           [FAILED]
Starting sidekiq: ERROR: RVM Ruby not used, run `rvm use ruby` first.
                                                           [FAILED]

But (Ruby install via rvm.)

ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System:     CentOS release 6.4 (Final)
Current User:   git
Using RVM:  yes
RVM Version:    1.22.3
Ruby Version:   2.0.0p247
Gem Version:    2.0.3
Bundler Version:1.3.5
Rake Version:   10.1.0
@axilleas
Copy link
Contributor

axilleas commented Sep 2, 2013

What is the output of rvm env and which ruby?

@mobdim
Copy link
Author

mobdim commented Sep 3, 2013

rvm env

export PATH ; PATH="/usr/local/rvm/gems/ruby-2.0.0-p247/bin:/usr/local/rvm/gems/ruby-2.0.0-p247@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p247/bin:/usr/local/rvm/bin:$PATH"
export rvm_env_string ; rvm_env_string='ruby-2.0.0-p247'
export rvm_path ; rvm_path='/usr/local/rvm'
export rvm_ruby_string ; rvm_ruby_string='ruby-2.0.0-p247'
unset rvm_gemset_name
export RUBY_VERSION ; RUBY_VERSION='ruby-2.0.0-p247'
export GEM_HOME ; GEM_HOME='/usr/local/rvm/gems/ruby-2.0.0-p247'
export GEM_PATH ; GEM_PATH='/usr/local/rvm/gems/ruby-2.0.0-p247:/usr/local/rvm/gems/ruby-2.0.0-p247@global'
export MY_RUBY_HOME ; MY_RUBY_HOME='/usr/local/rvm/rubies/ruby-2.0.0-p247'
export IRBRC ; IRBRC='/usr/local/rvm/rubies/ruby-2.0.0-p247/.irbrc'
unset MAGLEV_HOME
unset RBXOPT

which ruby

/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby

@axilleas
Copy link
Contributor

axilleas commented Sep 3, 2013

This is a path problem. In init service the rvm path is /usr/local/rvm/bin, see gitlab-unicorn#L44. If you change this to /usr/local/rvm/ does it work as expected? I'll take a look at it later this day as I don't have access to a CentOS VM right now.

@mobdim
Copy link
Author

mobdim commented Sep 3, 2013

After being changed to /usr/local/rvm:

service gitlab start

Starting unicorn:bash: /usr/bin/bundle: /usr/bin/ruby: bad interpreter: No such file or directory
                                                           [FAILED]
Starting sidekiq: bash: /usr/bin/bundle: /usr/bin/ruby: bad interpreter: No such file or directory
                                                           [FAILED]

@ilkercapli
Copy link

My advices:

First check ruby:

which ruby

The result must looks like:

/usr/local/bin/ruby

If it is not necessary using rvm don't use it.

yum remove rvm

Than follow the white rabbit:
https://github.com/gitlabhq/gitlab-recipes/tree/master/install/centos#2-ruby

You need follow one by one all steps correctly..

When you have got any problem during installation please share screens with us and we will try to solve them together.

@mobdim
Copy link
Author

mobdim commented Sep 3, 2013

It seems to me that compile ruby from source is not correct.
RVM use conveniently. Better would be to adapt the script to work in this mode.
I have running redmine ruby through rvm.

@ilkercapli
Copy link

And than, please write the result of

which ruby

You've got to add ruby bin filepath to bash profile or adding a symbolic link maybe solve your problem.
/usr/bin/ruby link to your ruby bin.

@ilkercapli
Copy link

# ------- Login as git user (if  you use username as git)
su - git

nano ~/.bash_profile

# -------- Make the following edits --------

# Change the PATH maybe you can fix ruby path or add your own system paths
PATH=$HOME/git/bin:$HOME/ruby/bin:$PATH:$HOME/bin;

# -------- Save and close the file --------

[git@server~] nano ~/.bashrc

# -------- Make the following edits --------

# Add this to the bottom. It's redundant but it solves a problem when gitlab calls /usr/bin/env
# Be sure what did you use above.. use same paths again.
PATH=$HOME/git/bin:$HOME/ruby/bin:$PATH:$HOME/bin;

# -------- Save and close the file --------

# Re-export your PATH Be sure what did you use above.. use same paths again.
[git@server~] PATH=$HOME/git/bin:$HOME/ruby/bin:$PATH:$HOME/bin;

# Verify your using the right version of Ruby now
[git@server~] which ruby
~/ruby/bin/ruby

@mobdim
Copy link
Author

mobdim commented Sep 3, 2013

#121 (comment)
which ruby

/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby

Found the solution. Thanks for the tips.
My solution:

/usr/bin/ruby -> /usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby

which ruby still /usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby
but

Starting unicorn:                                          [  OK  ]
Starting sidekiq:                                          [  OK  ]

@axilleas
Copy link
Contributor

axilleas commented Sep 3, 2013

Cool, I'll change the RVM_PATH in init script but there's got to be some other way to avoid the symbolic link and make this work seamlessly. Maybe add another variable with which ruby and then append this to the RUBY_PATH_PATCH. Leave this open to remind me make the change.

@ilkercapli
Copy link

@axilleas that sounds better I think :)

@axilleas
Copy link
Contributor

The script has changed since you reported this and I think it handles rvm too. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants