Upgrade from artful to bionic

Asked by Kushal on 2018-07-12

How do I upgrade from artful to bionic?

I have done the dist upgrade. I have ruby 2.5 now but rake and bundle seem to expect ruby 2.3? What is my next step? Thank you!

Sincerely,

user@domain ~ $ ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
lila@library2 ~ $ rake --version
-bash: /usr/local/bin/rake: /usr/bin/ruby2.3: bad interpreter: No such file or directory
lila@library2 ~ $ bundle --version
-bash: /usr/local/bin/bundle: /usr/bin/ruby2.3: bad interpreter: No such file or directory
user@domain ~ $ cat /usr/local/bin/rake
#!/usr/bin/ruby2.3
#
# This file was generated by RubyGems.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

load Gem.bin_path('rake', 'rake', version)
lila@domain ~ $ cat /usr/local/bin/bundle
#!/usr/bin/ruby2.3
#
# This file was generated by RubyGems.
#
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

load Gem.bin_path('bundler', 'bundle', version)
user@domain ~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu redmine Edit question
Assignee:
No assignee Edit question
Solved by:
Kushal
Solved:
2018-07-13
Last query:
2018-07-13
Last reply:
2018-07-13

This question was reopened

Manfred Hampl (m-hampl) said : #1

I assume that you are using versions from a foreign source instead of the Ubuntu-provided ones (rake and bundle should reside in /usr/bin and not in /usr/local/bin)

For diagnostic purposes, what is the output of the commands

uname -a
which ruby
which rake
apt-cache policy ruby rake
/usr/bin/rake --version
/usr/bin/bundle --version

Kushal (hadakushal) said : #2

user@domain ~ $ uname -a
Linux domain 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
user@domain ~ $ which ruby
/usr/bin/ruby
user@domain ~ $ which rake
/usr/local/bin/rake
user@domain ~ $ apt-cache policy ruby rake
ruby:
  Installed: 1:2.5.1
  Candidate: 1:2.5.1
  Version table:
 *** 1:2.5.1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
rake:
  Installed: 12.3.1-1
  Candidate: 12.3.1-1
  Version table:
 *** 12.3.1-1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic/main i386 Packages
        100 /var/lib/dpkg/status
user@domain ~ $ /usr/bin/rake --version
rake, version 12.3.1
user@domain ~ $ /usr/bin/bundle --version
Bundler version 1.16.1
user@domain ~ $ cat /usr/bin/rake
#!/usr/bin/ruby

#--
# Copyright (c) 2003, 2004, 2005, 2006, 2007 Jim Weirich
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#++

require "rake"

Rake.application.run
user@domain ~ $ cat /usr/bin/bundle
#!/usr/bin/ruby
# frozen_string_literal: true

# Exit cleanly from an early interrupt
Signal.trap("INT") do
  Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
  exit 1
end

require "bundler"
# Check if an older version of bundler is installed
$LOAD_PATH.each do |path|
  next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9
  err = String.new
  err << "Looks like you have a version of bundler that's older than 0.9.\n"
  err << "Please remove your old versions.\n"
  err << "An easy way to do this is by running `gem cleanup bundler`."
  abort(err)
end

require "bundler/friendly_errors"
Bundler.with_friendly_errors do
  require "bundler/cli"

  # Allow any command to use --help flag to show help for that command
  help_flags = %w[--help -h]
  help_flag_used = ARGV.any? {|a| help_flags.include? a }
  args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV

  Bundler::CLI.start(args, :debug => true)
end

Manfred Hampl (m-hampl) said : #3

As expected. You have installed some foreign versions of rake and bundle which apparently do not work on Ubuntu 18.04.

Recommended solution: Delete these foreign versions and use the Ubuntu-provided packages.

Kushal (hadakushal) said : #4

Thank you!