LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installation help for gitlab (https://www.linuxquestions.org/questions/linux-newbie-8/installation-help-for-gitlab-4175498342/)

NotionCommotion 03-15-2014 08:42 PM

Installation help for gitlab
 
I am trying to install gitlab and am following https://github.com/gitlabhq/gitlab-r...install/centos It is an existing Centos 6.2 server (not 6.5) with MySQL. I got 90% through it, but am receiving the below error. I know almost nothing about Ruby/Gems, and would appreciate some insight where I am going astray. Thank you

Code:

[root@desktop gitlab]# sudo -u git -H /usr/local/bin/bundle install --deployment --without development test postgres aws
Fetching source index from https://rubygems.org/
Fetching https://github.com/gitlabhq/markup.git
remote: Counting objects: 1024, done.
remote: Compressing objects: 100% (548/548), done.
remote: Total 1024 (delta 367), reused 1024 (delta 367)
Receiving objects: 100% (1024/1024), 147.02 KiB, done.
Resolving deltas: 100% (367/367), done.
Installing rake (10.1.1)
Installing ace-rails-ap (2.0.1)
Installing i18n (0.6.9)
Using minitest (4.7.5)
Installing multi_json (1.8.4)
Installing atomic (1.1.14)
Installing thread_safe (0.1.3)
Installing tzinfo (0.3.38)
Installing activesupport (4.0.3)
Installing builder (3.1.4)
Installing erubis (2.7.0)
Installing rack (1.5.2)
Installing rack-test (0.6.2)
Installing actionpack (4.0.3)
Installing mime-types (1.25.1)
Installing polyglot (0.3.4)
Installing treetop (1.4.15)
Installing mail (2.5.4)
Installing actionmailer (4.0.3)
Installing actionpack-action_caching (1.1.0)
Installing actionpack-page_caching (1.0.2)
Installing activemodel (4.0.3)
Installing activerecord-deprecated_finders (1.0.3)
Installing arel (4.0.2)
Installing activerecord (4.0.3)
Using bundler (1.5.3)
Installing thor (0.18.1)
Installing railties (4.0.3)
Installing hike (1.2.3)
Installing tilt (1.4.1)
Installing sprockets (2.10.1)
Installing sprockets-rails (2.0.1)
Installing rails (4.0.3)
Installing acts-as-taggable-on (2.4.1)
Installing asciidoctor (0.1.4)
Installing descendants_tracker (0.0.3)
Installing ice_nine (0.10.0)
Installing axiom-types (0.0.5)
Installing bcrypt-ruby (3.1.2)
Installing sass (3.2.12)
Installing bootstrap-sass (3.0.3.0)
Using json (1.8.1)
Installing carrierwave (0.9.0)
Installing timers (1.1.0)
Installing celluloid (0.15.2)
Installing charlock_holmes (0.6.9.4)
Installing coercible (1.0.0)
Installing coffee-script-source (1.6.3)
Installing execjs (2.0.2)
Installing coffee-script (2.2.0)
Installing coffee-rails (4.0.1)
Installing colored (1.2)
Installing connection_pool (1.2.0)
Installing d3_rails (3.1.10)
Installing orm_adapter (0.5.0)
Installing warden (1.2.3)
Installing devise (3.0.4)
Installing devise-async (0.8.0)
Installing diff-lcs (1.2.5)
Installing dotenv (0.9.0)
Installing email_validator (1.4.0)
Installing enumerize (0.7.0)
Installing equalizer (0.0.8)
Installing escape_utils (0.2.4)
Installing eventmachine (1.0.3)
Installing multipart-post (1.2.0)
Installing faraday (0.8.8)
Installing faraday_middleware (0.9.0)
Installing font-awesome-rails (3.2.1.3)
Installing foreman (0.63.0)
Installing gemoji (1.3.1)
Installing github-markdown (0.5.5)
Using github-markup (0.7.6) from https://github.com/gitlabhq/markup.git (at 61ade38)
Installing posix-spawn (0.3.8)
Installing gitlab-grit (2.6.4)
Installing gitlab-flowdock-git-hook (0.4.2.2)
Installing nokogiri (1.5.10)
Installing sanitize (2.0.6)
Installing stringex (1.5.1)
Installing gitlab-gollum-lib (1.1.0)
Installing gitlab-grack (2.0.0.pre)
Installing gitlab-linguist (3.0.0)
Installing rugged (0.19.0)
Installing gitlab_git (5.4.0)
Installing gitlab_meta (6.0)
Installing net-ldap (0.3.1)
Installing hashie (2.0.5)
Installing omniauth (1.1.4)
Installing pyu-ruby-sasl (0.0.3.3)
Installing rubyntlm (0.1.1)
Installing gitlab_omniauth-ldap (1.0.4)
Installing gon (5.0.1)
Installing multi_xml (0.5.5)
Installing rack-accept (0.4.5)
Installing rack-mount (0.8.3)
Installing virtus (1.0.1)
Installing grape (0.6.1)
Installing grape-entity (0.3.0)
Installing haml (4.0.4)
Installing haml-rails (0.5.1)
Installing httparty (0.12.0)
Installing hipchat (0.14.0)
Installing http_parser.rb (0.5.3)
Installing httpauth (0.2.0)
Installing jquery-atwho-rails (0.3.3)
Installing jquery-rails (2.1.3)
Installing turbolinks (2.0.0)
Installing jquery-turbolinks (2.0.1)
Installing jquery-ui-rails (2.0.2)
Installing jwt (0.1.8)
Installing kaminari (0.15.1)
Installing kgio (2.8.1)
Installing libv8 (3.16.14.3)
Installing modernizr (2.6.2)

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing.  please check your installation of mysql and try again.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/ruby
        --with-mysql-config
        --without-mysql-config

extconf failed, exit code 1

Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/mysql2-0.3.11 for inspection.
Results logged to /home/git/gitlab/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/mysql2-0.3.11/gem_make.out
An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
[root@desktop gitlab]#


redd9 03-15-2014 08:51 PM

I don't know much about gems either, but have you tried uninstalling and reinstalling mysql? Or installing it if you didn't have it in the first place.

NotionCommotion 03-15-2014 09:13 PM

Quote:

Originally Posted by redd9 (Post 5135309)
I don't know much about gems either, but have you tried uninstalling and reinstalling mysql? Or installing it if you didn't have it in the first place.

Hi Redd9, MySQL is working great. I haven't, however, tried uninstalling and reinstalling. Any reason I should?

knudfl 03-16-2014 04:29 AM

I'd guess you are missing the development parts of mysql.
I.e. you cannot build a "Mysql application" with the "run time mysql" only.

Install the package that provides mysql.h and other development files :

sudo apt-get install libmysqlclient-dev
EDIT : Would be # 'yum install mysql-devel' for CentOS.

-

NotionCommotion 03-16-2014 06:45 AM

Quote:

Originally Posted by knudfl (Post 5135432)
I'd guess you are missing the development parts of mysql.
I.e. you cannot build a "Mysql application" with the "run time mysql" only.

Install the package that provides mysql.h and other development files :

sudo apt-get install libmysqlclient-dev

-

One more thing that might make a difference. When installing MySQL, I used a ius repo, and used the following. Could it be a library conflict?
Code:

yum install mysql55 mysql55-server

knudfl 03-16-2014 07:21 AM

# 5.

Sorry, it's "mysql-devel" from the CentOS "base.repo"

But : When you have chosen "mysql55"/ius :
The required development file from the ius.repo : # yum install mysql55-devel
* 32 http://dl.iuscommunity.org/pub/ius/s...r_m.group.html
* 64 http://dl.iuscommunity.org/pub/ius/s...r_m.group.html

.. Will provide /usr/include/mysql/{mysql.h, 33-other-files.h, mysql/**}
.. and /usr/lib(64)/mysql/{libmysqlclient_r.so, libmysqlclient.so}

* The command to find a package providing mysql.h is $ yum provides */mysql.h


-

NotionCommotion 03-16-2014 08:04 AM

Thanks knudfl, that did the trick!

Ran into another snag. What does the following mean? Thank you
Code:

[root@desktop gitlab]# sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
sudo: bundle: command not found
[root@desktop gitlab]#


knudfl 03-16-2014 08:18 AM

# 7 .

That a good question as ..
$ yum 'provides */bundle' probably will reply with a lot of packages.

But you are using ruby, so why not try # yum install rubygem-bundler
→ → /usr/bin/bundle

Note : 'rubygem-bundler' should be in "CentOS-extra.repo" :
You may have to enable "extra" ? ( edit enable=0 to enable=1 ).

-

NotionCommotion 03-16-2014 08:27 AM

I tried the command without sudo, and made some progress. Think it is okay doing so as root, or will this mess permissions, etc up? Maybe I should not have attempted to do the original install as root?
Code:

[root@desktop gitlab]# bundle exec rake gitlab:setup RAILS_ENV=production
 Warning
  You are running as user root, we hope you know what you are doing.
  Things may work/fail for the wrong reasons.
  For correct results you should run this as user git.

This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? n
Do you want to continue (yes/no)? ^Crake aborted!

I then logged in as git (had to change user to allow remote access), but no progress.
Code:

-sh-4.1$ cd /home/git/gitlab
-sh-4.1$ sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
git is not in the sudoers file.  This incident will be reported.
-sh-4.1$

Thanks!

NotionCommotion 03-16-2014 08:42 AM

I changed owner of all files in /home/git to "git", and then as user git, did the following without the sudo, and it appeared to work. I am in uncharted territory :(

Code:

bundle exec rake gitlab:setup RAILS_ENV=production

John VV 03-16-2014 11:57 AM

you did point the out of date yum to the historical archive " the vault"

the 6.2 repos were removed a year ago
http://vault.centos.org/
after 6.2 went "end of life" back in July of 2012

and please HEED the warning from cent about using a unsupported OS
-- the place holder in the old 6.2 repo mirrors
http://mirrors.arsc.edu/centos/6.2/readme
Quote:

This directory (and version of CentOS) is depreciated. For normal users,
you should use /6/ and not /6.2/ in your path. Please see this FAQ
concerning the CentOS release scheme:

http://www.centos.org/modules/smartfaq/faq.php?faqid=34

If you know what you are doing, and absolutely want to remain at the 6.2
level, go to http://vault.centos.org/ for packages.

Please keep in mind that 6.0, 6.1 and 6.2 no longer gets any updates, nor
any security fix's.

NotionCommotion 03-16-2014 01:00 PM

Thanks John,

I just realized I am at 6.5. I forgot that I installed at 6.4, not 6.2, and update must have gotten me to 6.5?

knudfl 03-16-2014 01:05 PM

# 12 : $ cat /etc/redhat-release

The file /etc/redhat-release , etc. **-release are updated, when you do:
# yum update

NotionCommotion 03-17-2014 09:00 AM

Hello again, I am still stumped on the below line.

Code:

[root@desktop gitlab]# sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
sudo: bundle: command not found
[root@desktop gitlab]#

I tried installing rubygem-bundler, but I got "No package rubygem-bundler available" (yes, I extra is enabled).

What is odd is why can I execute bundle without sudo?????????????

Code:

[root@desktop gitlab]# bundle exec rake gitlab:setup RAILS_ENV=production
 Warning
  You are running as user root, we hope you know what you are doing.
  Things may work/fail for the wrong reasons.
  For correct results you should run this as user git.

This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? no
Quitting...
[root@desktop gitlab]#

I don't want to do so as root user as it deviates from the documentation I am following and I don't totally know what I am doing.

John VV 03-17-2014 10:58 AM

you are using "sudo"
so did you set it up correctly ?
it is installed but disabled and not configured by default
the mysql DB is owned by the user "mysql"
is that user in the sudoers list

RHEL/CentOS/Fedora normally uses "su -" for installing software

NotionCommotion 03-17-2014 11:29 AM

Quote:

Originally Posted by John VV (Post 5136108)
you are using "sudo"
so did you set it up correctly ?
it is installed but disabled and not configured by default
the mysql DB is owned by the user "mysql"
is that user in the sudoers list

RHEL/CentOS/Fedora normally uses "su -" for installing software

Thanks John,

I was logged on as root. I've since tried logging on as a normal user, and used "su" (not "su - somecommand"), but no difference. I've been using sudo earlier per the install instructions with no problem.

bundle is located at /usr/local/bin/bundle, and I ran visudo, and added /usr/local/bin to the path.
Code:

[root@desktop gitlab]# whereis bundle
bundle: /usr/local/bin/bundle
root@desktop etc]# echo 'echo $PATH' | sh
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@desktop etc]# echo 'echo $PATH' | sudo sh
/sbin:/bin:/usr/sbin:/usr/bin:/user/local/bin


NotionCommotion 03-17-2014 11:49 AM

Does the following shed any light? Why do I need to specify the full file path if it is already in my sudo path (see my previous post). Thank you

Code:

[root@desktop gitlab]# sudo -u git -H bundle
sudo: bundle: command not found

[root@desktop gitlab]# sudo -u git -H /usr/local/bin/bundle
Using rake (10.1.1)
Using ace-rails-ap (2.0.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.3)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.3)
Using mime-types (1.25.1)
Using polyglot (0.3.4)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.3)
Using actionpack-action_caching (1.1.0)
Using actionpack-page_caching (1.0.2)
Using activemodel (4.0.3)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.2)
Using activerecord (4.0.3)
Using bundler (1.5.3)
Using thor (0.18.1)
Using railties (4.0.3)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.10.1)
Using sprockets-rails (2.0.1)
Using rails (4.0.3)
Using acts-as-taggable-on (2.4.1)
Using asciidoctor (0.1.4)
Using descendants_tracker (0.0.3)
Using ice_nine (0.10.0)
Using axiom-types (0.0.5)
Using bcrypt-ruby (3.1.2)
Using sass (3.2.12)
Using bootstrap-sass (3.0.3.0)
Using json (1.8.1)
Using carrierwave (0.9.0)
Using timers (1.1.0)
Using celluloid (0.15.2)
Using charlock_holmes (0.6.9.4)
Using coercible (1.0.0)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using coffee-rails (4.0.1)
Using colored (1.2)
Using connection_pool (1.2.0)
Using d3_rails (3.1.10)
Using orm_adapter (0.5.0)
Using warden (1.2.3)
Using devise (3.0.4)
Using devise-async (0.8.0)
Using diff-lcs (1.2.5)
Using dotenv (0.9.0)
Using email_validator (1.4.0)
Using enumerize (0.7.0)
Using equalizer (0.0.8)
Using escape_utils (0.2.4)
Using eventmachine (1.0.3)
Using multipart-post (1.2.0)
Using faraday (0.8.8)
Using faraday_middleware (0.9.0)
Using font-awesome-rails (3.2.1.3)
Using foreman (0.63.0)
Using gemoji (1.3.1)
Using github-markdown (0.5.5)
Using github-markup (0.7.6) from https://github.com/gitlabhq/markup.git (at 61ade38)
Using posix-spawn (0.3.8)
Using gitlab-grit (2.6.4)
Using gitlab-flowdock-git-hook (0.4.2.2)
Using nokogiri (1.5.10)
Using sanitize (2.0.6)
Using stringex (1.5.1)
Using gitlab-gollum-lib (1.1.0)
Using gitlab-grack (2.0.0.pre)
Using gitlab-linguist (3.0.0)
Using rugged (0.19.0)
Using gitlab_git (5.4.0)
Using gitlab_meta (6.0)
Using net-ldap (0.3.1)
Using hashie (2.0.5)
Using omniauth (1.1.4)
Using pyu-ruby-sasl (0.0.3.3)
Using rubyntlm (0.1.1)
Using gitlab_omniauth-ldap (1.0.4)
Using gon (5.0.1)
Using multi_xml (0.5.5)
Using rack-accept (0.4.5)
Using rack-mount (0.8.3)
Using virtus (1.0.1)
Using grape (0.6.1)
Using grape-entity (0.3.0)
Using haml (4.0.4)
Using haml-rails (0.5.1)
Using httparty (0.12.0)
Using hipchat (0.14.0)
Using http_parser.rb (0.5.3)
Using httpauth (0.2.0)
Using jquery-atwho-rails (0.3.3)
Using jquery-rails (2.1.3)
Using turbolinks (2.0.0)
Using jquery-turbolinks (2.0.1)
Using jquery-ui-rails (2.0.2)
Using jwt (0.1.8)
Using kaminari (0.15.1)
Using kgio (2.8.1)
Using libv8 (3.16.14.3)
Using modernizr (2.6.2)
Using mysql2 (0.3.11)
Using oauth (0.4.7)
Using oauth2 (0.8.1)
Using omniauth-oauth2 (1.1.1)
Using omniauth-github (1.1.1)
Using omniauth-google-oauth2 (0.2.1)
Using omniauth-oauth (1.0.1)
Using omniauth-twitter (1.0.1)
Using protected_attributes (1.0.5)
Using rack-attack (2.3.0)
Using rack-cors (0.2.9)
Using rack-protection (1.5.1)
Using rails-observers (0.1.2)
Using raindrops (0.12.0)
Using raphael-rails (2.1.2)
Using redcarpet (2.2.2)
Using redis (3.0.6)
Using redis-store (1.1.4)
Using redis-rack (1.5.0)
Using redis-actionpack (4.0.0)
Using redis-activesupport (4.0.0)
Using redis-namespace (1.4.1)
Using redis-rails (4.0.0)
Using ref (1.0.5)
Using sass-rails (4.0.1)
Using seed-fu (2.3.0)
Using select2-rails (3.5.2)
Using settingslogic (2.0.9)
Using sidekiq (2.17.0)
Using simple_oauth (0.1.9)
Using sinatra (1.4.4)
Using six (0.2.0)
Using temple (0.6.7)
Using slim (2.0.2)
Using stamp (0.5.0)
Using state_machine (1.2.0)
Using therubyracer (0.12.0)
Using twitter-stream (0.1.16)
Using tinder (1.9.3)
Using uglifier (2.3.2)
Using underscore-rails (1.4.4)
Using unicorn (4.6.3)
Using unicorn-worker-killer (0.4.2)
Your bundle is complete!
Gems in the groups development, test, postgres and aws were not installed.
It was installed into ./vendor/bundle

[root@desktop gitlab]# sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS_ENV=production
/usr/bin/env: ruby: No such file or directory
[root@desktop gitlab]#


NotionCommotion 03-17-2014 12:00 PM

I am an idiot!

I had /user/local/bin in my sudo path.

John VV 03-17-2014 12:29 PM

there is a VERY !!! big difference in "su" and su -"

for any program that is in /sbin
"su - "MUST!!!! be used

su = root BUT WITH THE NORMAL USER'S $PATH
su - = root BUT using the ROOT accounts DIFFERENT $PATH

NotionCommotion 03-17-2014 04:10 PM

Quote:

Originally Posted by John VV (Post 5136157)
there is a VERY !!! big difference in "su" and su -"

for any program that is in /sbin
"su - "MUST!!!! be used

su = root BUT WITH THE NORMAL USER'S $PATH
su - = root BUT using the ROOT accounts DIFFERENT $PATH

Didn't mean no difference in "su" and "su -", but no difference with the outcome.

Didn't understand the differences between "su" and "su -", but now I do. Thanks


All times are GMT -5. The time now is 12:40 PM.