Unable to install bundle: rbenv: bundle: command not found

Follow

Comments

4 comments

  • Avatar
    Mark Hutton

    Although the application (Redmine) runs fine as configured in the Web GUI, there are gems that don't seem to be updated when bundle install is run from the GUI.

    Although, the reported version of ruby is 2.3.6 in the GUI, and the bundle install and rake commands work (somewhat) as expected, the ruby version reported by the CLI is NOT 2.3.6, but 2.0.0.

    Trying to run rbenv exec results in rbenv: version `2.3.6' is not installed (set by /var/www/vhosts/projexz.co.uk/httpdocs/redmine/.ruby-version).

    Though rbenv commands works fine.

    The result of this instruction (with root login) gem install bundler is

    Fetching: bundler-2.0.1.gem (100%)
    ERROR:  Error installing bundler:
            bundler requires Ruby version >= 2.3.0.

     

    The result with a subscriber login is

    $gem install bundler --user-install
    WARNING:  You don't have /var/www/vhosts/projexz.co.uk/.gem/ruby/2.3.0/bin in your PATH,
              gem executables will not run.
    Successfully installed bundler-2.0.1
    Parsing documentation for bundler-2.0.1
    Installing ri documentation for bundler-2.0.1
    Done installing documentation for bundler after 6 seconds
    1 gem installed

    If I try the bundle update command again I get the following result.

    -bash-4.2$ bundle update redmine_crm
    Your Gemfile lists the gem redmine_crm (>= 0) more than once.
    You should probably keep only one of them.
    Remove any duplicate entries and specify the gem only once (per group).
    While it's not a problem now, it could cause errors if you change the version of one of them later.
    Your Gemfile lists the gem vcard (~> 0.2.8) more than once.
    You should probably keep only one of them.
    Remove any duplicate entries and specify the gem only once (per group).
    While it's not a problem now, it could cause errors if you change the version of one of them later.
    The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
    Fetching gem metadata from https://rubygems.org/..........
    Fetching gem metadata from https://rubygems.org/.
    Resolving dependencies...
    Bundler could not find compatible versions for gem "bundler":
      In Gemfile:
        rails (= 4.2.8) was resolved to 4.2.8, which depends on
          bundler (< 2.0, >= 1.3.0)

      Current Bundler version:
        bundler (2.0.1)
    This Gemfile requires a different version of Bundler.
    Perhaps you need to update Bundler by running `gem install bundler`?

    Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails
    (= 4.2.8)', in any of the sources.

    0
    Comment actions Permalink
  • Avatar
    Mark Hutton (Edited )

     

    The issue appears to revolve around this

    Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails
    (= 4.2.8)', in any of the sources.

    which isn't useful in this context as gem install bundler will update not downgrade the gem.

    Incidentally this has now broken my site completely. No access and bundle install cannot be run from the GUI either.

     

    0
    Comment actions Permalink
  • Avatar
    Mark Hutton (Edited )

    Resolved:

    Bundler versions are Rails version dependent (? see Note below)..

    # gem install bundler --user-install

    will install the latest bundler version. Bundler versions 2 and above are for Rails 5.

    If you have Rails 4 installed then you must use 1.17.3 as the highest version.

    [Note: Not sure if this is just the gemfile.lock definition or if is a hard requirement for Rails (will check)].

    In any case to install a particular version of bundler use the following command.

    # gem install bundler --version '1.17.3' --user-install

    I had to delete gemfile.lock, restart the application and then run bundle install before it would all work.

     

     

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Mark,

    Thank you for the detailed messaged. Indeed, usually, the error which you have faced has a different cause and described here.

    Glad to know that you have resolved the issue. It may be useful for other Pleskians.

    As for Ruby on Rails specific questions, it is better to address them directly to the official forum. More information may be found here.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request