Why doesn't "gem install bundler" upgrade my bundler? - ruby-on-rails-4

I’m trying to upgrade from Rails 4.2 to Rails 6. I have this in my Gemfile
fail "run 'gem install bundler' to update your bundler version" unless Bundler::VERSION >= '2.0.0'
source 'https://rubygems.org'
ruby '~> 2.6.7'
gem 'rails', '~> 6.0.0'
And when I install, I get the failure
$ bundle install
[!] There was an error parsing `Gemfile`: run 'gem install bundler' to update your bundler version. Bundler cannot continue.
# from /Users/davea/workspace/my-app/Gemfile:1
# -------------------------------------------
> fail "run 'gem install bundler' to update your bundler version" unless Bundler::VERSION >= '2.0.0'
# source 'https://rubygems.org'
# -------------------------------------------
So I wanted to upgrade bundler, and ran
$ gem install bundler
Successfully installed bundler-2.2.31
Parsing documentation for bundler-2.2.31
Done installing documentation for bundler after 2 seconds
1 gem installed
But this doesn’t seem to upgrade anything. I still get the same error
$ bundle install
[!] There was an error parsing `Gemfile`: run 'gem install bundler' to update your bundler version. Bundler cannot continue.
# from /Users/davea/workspace/my-app/Gemfile:1
# -------------------------------------------
> fail "run 'gem install bundler' to update your bundler version" unless Bundler::VERSION >= '2.0.0'
# source 'https://rubygems.org'
# -------------------------------------------
The version still seems stuck on the old version
$ bundle -v
Bundler version 1.17.3
$ bin/bundle -v
Bundler version 1.17.3
Even running
$ gem update bundler
Updating installed gems
Nothing to update
Doesn’t help. How do I upgrade my bundler?

Check your Gemfile entry versions and make sure Gemfile.lock is in your version control and then:
bundle update --bundler

Related

Could not find method_source-1.0.0.gem for installation

I want to install redmine as a source by referring to the URL below.
https://www.redmine.org/projects/redmine/wiki/RedmineInstall
When I run the below in "Step 4 - Dependencies installation", I get an error.
/opt/redmine/redmine-5.0.0$ sudo bundler install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
:
Installing method_source 1.0.0
Bundler::GemNotFound: Could not find method_source-1.0.0.gem for installation
:
/usr/local/bin/bundler:25:in `load'
/usr/local/bin/bundler:25:in `'
:
An error occurred while installing method_source (1.0.0), and Bundler cannot continue.
In Gemfile:
actionpack-xml_parser was resolved to 2.0.1, which depends on
railties was resolved to 6.1.4.7, which depends on
method_source
Im fixed this error by install gem manually:
gem install method_source

Rails/Centos7 - ERROR: Error installing rails: ERROR: Failed to build gem native extension

I got this error message when trying to install rails on Centos 7.
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
Gem files will remain installed in /usr/local/share/gems/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /usr/local/share/gems/gems/nokogiri-1.6.6.2/ext/nokogiri/gem_make.out
Command
gem install rails -v 4.2.3 --no-rdoc --no-ri
Nokogiri is causing you problems. Installing all the build dependencies and try again.
sudo yum install -y gcc ruby-devel zlib-devel libxml2 libxml2-devel libxslt libxslt-devel make
If it still fails, try to build it with the --use-system-libraries build option.
gem install nokogiri -- --use-system-libraries
If all else fails, install it from the EPEL repository.
sudo yum install -y epel-release
sudo yum install -y rubygem-nokogiri

ERROR: While executing gem (OpenSSL::SSL::SSLError) SSL_read: Wrong version number

I installed Ruby 2.2.2 x64 and gem version 2.4.6. on Windows 7 64
I've run gem update --system
I get the above error when doing gem install rails --no-ri --no-rdoc
I've researched Google, but found no relevant answer. Any ideas?
RailsInstaller is the best package for installing rails on windows.It includes all required Packages. RilasInstaller - http://railsinstaller.org/en

Rails 4 bundler: command not found: rails

I am guessing that this answer has been already answered somewhere but I was not able to find it. I am having troubles with installing Rails 4. I have put in the Gemfile:
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
And I have run bundle install --path vendor/bundle and all the gems are installed, but when I run bundle exec rails s then I receive an error:
bundler: command not found: rails
Install missing gem executables with `bundle install`
which rails doesn't returning anything. I am using ruby 2.0.0 and rvm and it seems everything has been set up.
What am I missing and how to set-up Rails 4?
What solved my problem for Rails 4, in this case, was running a command in the root directory of the application:
bundle exec rake rails:update:bin
After that , running a bundle exec rails s reported no errors and was working as expected.
In Gemfile please add
ruby 2.0.0
or
Try to use .ruby-version and .ruby-gemset.
Please read this

ActiveAdmin: gem not checkout, run bundle install first

In a Rails 4 app, I am trying to use ActiveAdmin 1.0.pre2. bundle install doesn't complain and seems to have included the gem and it works properly.
I am having this in my gem file:
gem 'activeadmin', github: 'gregbell/active_admin'
$> bundle show activeadmin
/home/aslam/.rvm/gems/ruby-2.1.0#monaeo/bundler/gems/active_admin-3fb7f03335b1
Even after running bundle install several times, I keep getting the following error:
git://github.com/gregbell/active_admin.git (at master) is not yet checked out.
Run `bundle install` first.
I am using
Bundler version 1.6.0.rc2 (upgraded from 1.5.3)
Ruby: ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
Rails: 4.0.4
I am not sure what is going wrong here?
Try to install a prerelease version of Bundler:
gem install bundler --pre
It should solve the problem.
Use following in the Gemfile
gem 'activeadmin', :git => "git://github.com/gregbell/active_admin.git"
This way when you run bundle install, activeadmin would be sourced from its github repository.
Two things
A. You need to include like this in the gem file since 0.6.x is stable and maintained.
gem 'activeadmin', github: 'gregbell/active_admin', branch: '0-6-stable'
B. You can give a try by forking from the stable version of activeadmin
My solution:
rake rails:update:bin
bundle install