Replace Github-linguist with source github version

First of all, we need to locate our github-linguist files which will be replaced. We will also need ruby-build and gcc.

find / -name languages.yml
apt-get install ruby-build gcc
ruby-build 2.1.0 /opt/gitlab/embedded/service/gem/ruby/2.1.0
cd /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/
wget https://github.com/github/linguist/archive/v4.7.5.tar.gz
tar -xvzf v4.7.5.tar.gz
mv linguist-4.7.5/ github-linguist-4.7.5
rm -f v4.7.5.tar.gz
# Install all ruby dependencies
bundle install

Generate samples.json:

After download from github,

bundle exec rake check_samples

Otherwise, we will face this error in logs

2016-03-30_07:49:38.08294 No such file or directory @ rb_sysopen - /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/github-linguist-4.7.5/lib/linguist/samples.json

Fetch all ace modes

bundle exec rake fetch_ace_modes

Problems with bundle install

gem install byebug -v '8.2.2'
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

Solved

apt-get install ruby-dev

When running bundle install, charlock_holmes would not be installed

gem install charlock_holmes -v '0.7.3'
(..)
checking for main() in -licui18n... no

Solved

apt-get install libicu-dev

We also had problems with rugged

gem install rugged -v '0.24.0'
(..)
checking for gmake... no
checking for cmake... no
checking for pkg-config... no
ERROR: CMake is required to build Rugged.

Solved

apt-get install cmake pkg-config
ln -s /usr/bin/make /usr/bin/gmake

 

 

Puppet: Argumentos erroneos, error en ruby

puppet labs

El agente de puppet no hace gestión de argumentos de entrada. En el caso de ser erróneo, da el siguiente error:

root@puppettest1:~# puppet agent ..server myserver  ..no-daemonize ..verbose ..waitforcert=60
dnsdomainname: Name or service not known
/usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:54:in `handle_serve': uninitialized constant Puppet::Network::Handler (NameError)
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:363:in `send'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:363:in `parse_options'
        from /usr/lib/ruby/1.8/optparse.rb:1298:in `call'
        from /usr/lib/ruby/1.8/optparse.rb:1298:in `parse_in_order'
        from /usr/lib/ruby/1.8/optparse.rb:1254:in `catch'
        from /usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
        from /usr/lib/ruby/1.8/optparse.rb:1248:in `order!'
        from /usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'
        from /usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:370:in `parse_options'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:305:in `run'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:416:in `hook'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:305:in `run'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:407:in `exit_on_fail'
        from /usr/lib/ruby/vendor_ruby/puppet/application.rb:305:in `run'
        from /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:69:in `execute'
        from /usr/bin/puppet:4

En versiones anteriores como 2.6, se requería añadir a mano en lib/puppet/application/agent.rb la línea

 require 'puppet/network/handler'

Para saber qué versión de puppet se está ejecutando

puppet agent --version

En version 2.7, hay que revisar los argumentos de entrada. En nuestro caso, al cortar y pegar, se habían sustituido los — por ..