0

I have set up Git server on Mac using the commands as specified at https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/requirements.md.

I am able to get the login page also when I hit the IP in browser. Others are also able to access my server, but when I clone using the command:

git clone gitlab@My.IP.Address.D:root/mobilesecurityproduct.git
Cloning into 'mobilesecurityproduct'...

I get the following error

env: ruby: No such file or directory
fatal: The remote end hung up unexpectedly

I checked the gitlab-shell for the env path and tried to replace it with output of which ruby, but I get the same error.

Can anyone help me out with this?

Thiago Lewin
  • 2,810
  • 14
  • 18
divya
  • 177
  • 2
  • 14
  • Are you sure that you have ruby installed on the machine, and correctly configured? – Abizern Jun 21 '13 at 16:42
  • That shell is presumably run under the `gitlab` user. Does that user have access to the ruby executable? – Casper Jun 21 '13 at 17:51
  • That clone address looks broken somehow. Are you sure that's the correct path? That looks like a Windows path of some sort. – tadman Jun 21 '13 at 18:42
  • @Abizem My Mac system had ruby 1.8 but I installed rvm and installed ruby 1.9.3 and deleted ruby from System/Framework/Ruby/version. Then I used rvm use 1.9.3 --default so that ruby 1.9.3 will be used by default.Also when I execute ruby -v it shows ruby 1.9.3 .Am not understanding where the problem is. – divya Jun 22 '13 at 11:46
  • @Casper In the git installation steps I created a user as gitlab.How can I check if this user has access to ruby? – divya Jun 22 '13 at 11:48
  • @tadman Am not understanding which path are you refering to,Once I hit my ip address in my browser and logged in as admin I created a new project after which I got a page which showed SSH/HTTP link which I have used to clone in command line.Is there something wrong that I am doing? – divya Jun 22 '13 at 11:52
  • Also on the git server page After creating a Project I do not get the option Files,Commits .I have options Network,Graphs,Wiki available to me.Is this because the cloning is not happening?Will I get the files,commit options only after cloning? – divya Jun 22 '13 at 12:19

1 Answers1

1

Ok, since you said you used rvm to install Ruby I assume you installed it the standard way, which means you installed it only for personal use under your own home directory.

The gitlab user will not have access to your home directory and therefore it cannot run the Ruby executable from there.

You will need to install Ruby system-wide.

In fact this is step 2 in the installation instructions:
https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md#2-ruby

mkdir /tmp/ruby && cd /tmp/ruby
curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz
cd ruby-1.9.3-p392
./configure
make
sudo make install

sudo gem install bundler --no-ri --no-rdoc

Following those instructions should fix it.

EDIT

As tadman pointed out using Homebrew might be a less intrusive way to install Ruby system wide on a Mac: Installing Ruby with Homebrew

Community
  • 1
  • 1
Casper
  • 33,403
  • 4
  • 84
  • 79
  • Thanks I will try this out.After installing ruby do I have to make changes for ruby environment variable? – divya Jun 22 '13 at 14:43
  • @divya No you should not have to. Ruby will be installed into one of the standard system paths, so it should be automatically available to all users after that. – Casper Jun 22 '13 at 18:46
  • Doing a source install is pretty heavy handed when there's tools like [Homebrew](http://mxcl.github.io/homebrew/) that will do this in a much cleaner way. – tadman Jun 23 '13 at 20:02
  • @Casper I am still getting the same error after executing the commands as told by you.I have ruby installed in /tmp/ruby/ruby-1.9.3.Do I need to make changes any any other files? Please suggest – divya Jun 24 '13 at 07:36
  • 1
    @divya Did you run `sudo make install`? If you did then ruby should have been installed into either `/usr/bin/ruby` or `/usr/local/bin/ruby`. Check those locations. – Casper Jun 24 '13 at 07:53
  • If it's in `/usr/local/bin` you can try this: `cd /usr/bin` and then `sudo ln -s /usr/local/bin/ruby .`. That will link ruby into `/usr/bin`, where it's most likely the `gitlab` shell will look for it. – Casper Jun 24 '13 at 08:31
  • @Casper Thanks for all your help. Yes I executed sudo make install, and I checked usr/local/bin and executed sudo ln -s /usr/local/bin/ruby. as told by you. Unfortunately I still get the same error,I am not understanding where am I going wrong. – divya Jun 25 '13 at 02:41
  • @divya Sorry I'm out of ideas too. There must be some fundamental mistake here. The command `env ruby` should work. You have to have a ruby executable in `/usr/bin/ruby` and check that it works. Other than that I don't know what the problem is, and would need to log into your machine to look around. In any case, for some reason the login `gitlab` cannot find the ruby executable. Why, I can't say without looking at your machine. You need to investigate it yourself. Look at everything so you UNDERSTAND how everything works, then analyze. You must understand it in order to fix it. – Casper Jun 25 '13 at 04:15