Gitlab 12.0 enterprise edition can't installed gems because rake missing

Hi,

I have an issue running the following :

$ sudo -u git -H bundle install --deployment --without development test mysql aws kerberos

I got the following error:

Using apollo_upload_server 2.0.0.beta.3
Using health_check 2.6.0
Using gettext_i18n_rails_js 1.3.0
Installing sassc 2.0.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/sassc-2.0.1/ext
/usr/local/bin/ruby -rrubygems /home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake RUBYARCHDIR\=/home/git/gitlab/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/sassc-2.0.1
RUBYLIBDIR\=/home/git/gitlab/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/sassc-2.0.1
/usr/local/bin/ruby: No such file or directory -- /home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake (LoadError)

rake failed, exit code 1

Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/sassc-2.0.1 for inspection.
Results logged to /home/git/gitlab/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/sassc-2.0.1/gem_make.out

An error occurred while installing sassc (2.0.1), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.0.1' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  sassc-rails was resolved to 2.1.0, which depends on
    sassc

I execute with user root the command from the error above:

# gem install sassc -v '2.0.1' --source 'https://rubygems.org/'

It succeed but the same issue persist. So it seems my issue is related to rake because it cannot be found in /home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake. I checked and rake gem is not installed. So did I missed a step ?

My ruby version is 2.6.6

It looks like you’re attempting to follow the install from source guide? You may find it a better experience to install and manage using the OmniBus packages instead.

/usr/local/bin/ruby: No such file or directory

From the error above it appears as if your Ruby interpreter is installed at a different location. Have you followed the step for Ruby remove and install at https://docs.gitlab.com/12.10/ee/install/installation.html#2-ruby?

What do you receive as output for the following commands, and are the returned paths also executable?

which ruby
which bundle
which gem

What operating system and distribution flavor/version are you using?

Hello,

Yes I am using the source package. Unfortunately, OmniBus package doesn’t exist for my distribution.

I missed the ruby error in the message. So I installed the 2.6.6 version and the command works fine now.

So I don’t know if I should open a new thread or use that one but now, I’m trying to migrate but the command failed:

$ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production --trace                                        

rake aborted!
LoadError: cannot load such file -- rails/all
/home/git/gitlab/config/application.rb:3:in `require'
/home/git/gitlab/config/application.rb:3:in `<top (required)>'
/home/git/gitlab/Rakefile:5:in `require'
/home/git/gitlab/Rakefile:5:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/rake_module.rb:29:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/rake_module.rb:29:in `load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:703:in `raw_load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:104:in `block in load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:103:in `load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:82:in `block in run'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/bin/rake:23:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.6.0/bin/rake:23:in `<top (required)>'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in `start'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'

Some info:

$ which ruby
/usr/local/bin/ruby

$ which bundle
/usr/local/bin/bundle

$ which gem
/usr/local/bin/gem