redmine-git-hosting/redmine_git_hosting

Repository does not exists in Gitolite and Rugged compiled features [ssh in red]

NisargPatel2022 opened this issue · 3 comments

All the installation has gone well except the following errors.
Please provide me with the necessary solution regarding the below attached error.
I have also attached the git_hosting.log file content in the photo.
Further after seeing the log file I followed the troubleshooting for the message log i.e unsupported URL protocol but I am getting the following error : -

nisarg@nisarg:/opt/redmine/redmine-4.2.4$ sudo gem install rugged -v='0.22.2'
Building native extensions. This could take a while...
ERROR:  Error installing rugged:
	ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.7.0/gems/rugged-0.22.2/ext/rugged
/usr/bin/ruby2.7 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20220504-8713-1qiazon.rb extconf.rb
checking for gmake... yes
checking for cmake... yes
checking for pkg-config... yes
 -- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Unix Makefiles"
 -- /usr/bin/gmake
checking for -lgit2... yes
checking for git2.h... yes
creating Makefile

current directory: /var/lib/gems/2.7.0/gems/rugged-0.22.2/ext/rugged
make DESTDIR\= clean

current directory: /var/lib/gems/2.7.0/gems/rugged-0.22.2/ext/rugged
make DESTDIR\=
compiling rugged.c
rugged.c: In function ‘rb_git_minimize_oid’:
rugged.c:280:31: warning: passing argument 3 of ‘rb_iterate’ from incompatible pointer type [-Wincompatible-pointer-types]
  280 |  rb_iterate(rb_each, rb_enum, &minimize_cb, (VALUE)shrt);
      |                               ^~~~~~~~~~~~
      |                               |
      |                               VALUE (*)(VALUE,  git_oid_shorten *) {aka long unsigned int (*)(long unsigned int,  git_oid_shorten *)}
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from rugged.h:33,
                 from rugged.c:25:
/usr/include/ruby-2.7.0/ruby/ruby.h:1984:40: note: expected ‘rb_block_call_func_t’ {aka ‘long unsigned int (*)(long unsigned int,  long unsigned int,  int,  const long unsigned int *, long unsigned int)’} but argument is of type ‘VALUE (*)(VALUE,  git_oid_shorten *)’ {aka ‘long unsigned int (*)(long unsigned int,  git_oid_shorten *)’}
 1984 | VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE);
      |                                        ^~~~~~~~~~~~~~~~~~~~
rugged.c:292:32: warning: passing argument 3 of ‘rb_iterate’ from incompatible pointer type [-Wincompatible-pointer-types]
  292 |   rb_iterate(rb_each, rb_enum, &minimize_yield, (VALUE)yield_data);
      |                                ^~~~~~~~~~~~~~~
      |                                |
      |                                VALUE (*)(VALUE,  VALUE *) {aka long unsigned int (*)(long unsigned int,  long unsigned int *)}
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from rugged.h:33,
                 from rugged.c:25:
/usr/include/ruby-2.7.0/ruby/ruby.h:1984:40: note: expected ‘rb_block_call_func_t’ {aka ‘long unsigned int (*)(long unsigned int,  long unsigned int,  int,  const long unsigned int *, long unsigned int)’} but argument is of type ‘VALUE (*)(VALUE,  VALUE *)’ {aka ‘long unsigned int (*)(long unsigned int,  long unsigned int *)’}
 1984 | VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE);
      |                                        ^~~~~~~~~~~~~~~~~~~~
compiling rugged_backend.c
compiling rugged_blame.c
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from rugged.h:33,
                 from rugged_blame.c:25:
rugged_blame.c: In function ‘rb_git_blame_each’:
/usr/include/ruby-2.7.0/ruby/ruby.h:1871:3: error: call to ‘rb_varargs_bad_length’ declared with attribute error:  argument length doesn't match
 1871 |   rb_varargs_bad_length(argc, vargc)), \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/ruby.h:2690:6: note: in expansion of macro ‘rb_varargs_argc_check’
 2690 |      rb_varargs_argc_check(rb_funcall_argc, rb_funcall_nargs), \
      |      ^~~~~~~~~~~~~~~~~~~~~
rugged_blame.c:263:10: note: in expansion of macro ‘rb_funcall’
  263 |   return rb_funcall(self, rb_intern("to_enum"), 1, CSTR2SYM("each"), self);
      |          ^~~~~~~~~~
make: *** [Makefile:245: rugged_blame.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.7.0/gems/rugged-0.22.2 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/rugged-0.22.2/gem_make.out

redmine_error1

redminerror2

redminerror3

From the documentation:

.features ⇒ Array
Returns an array representing the features that libgit2 was compiled with — this includes :threads (thread support), :https and :ssh.

However, Rugged.features returns just [:threads, :https]. :ssh is missing.

I've just written a small test to compare the original and the current version of Rugged.

require 'rugged'
puts Rugged::VERSION
puts Rugged.features.join("\n")

results from the original version:

$ ruby test.rb 
0.99.0
threads
https
ssh

and the current one:

$ ruby test.rb 
1.5.0.1
threads
https

You need to bundle config build.rugged --with-ssh and then reinstall all your gems