I have installed ruby 1.9.3 using rvm and after doing gem install rails, it says gem successfully downloaded, but when I type rails -v it gives me the following error:
Unable to activate rails-3.0.1, because bundler-1.5.1 conflicts with bundler (~> 1.0.0) (Gem::LoadError)
How do I fix this?
do this:
rvm #global do gem uninstall bundler -ax
gem install bundler -v '~>1.0.0'
this will remove the globally installed bundler (available for all gemsets on this ruby) and install compatible local version only for current gemset.
Related
I am trying to bundle install a project running gem 'rails', '4.2.0'.
Running Bundle install, I get :
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.2.0) was resolved to 4.2.0, which depends on
bundler (>= 1.3.0, < 2.0)
Current Bundler version:
bundler (2.1.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (>= 1.3.0, < 2.0)', which is required by gem 'rails (= 4.2.0)', in any of the sources.
Thus I then try to install bundler v 1.3.0 to successfully bundle this gemfile : gem install bundler -v 1.3.0
gem list bundler shows me that I successfully installed bundler at v 1.3.0
Then when trying to bundle install with v 1.3.0 like this bundle _1.3.0_ install, I get Could not find command "_1.3.0_".
How can I successfully run bundle install with that specific version of bundler ?
Basically, you need:
Bundler (>= 1.3.0, < 2.0) installed on your local machine.
Ability to run that Bundler version.
Run that Bundler version to install other gems required by your app (bundle install).
First, check if you have successfully install Bundler (>= 1.3.0, < 2.0) on your local machine:
$ gem list bundler
You should see:
*** LOCAL GEMS ***
bundler (2.1.4, 1.17.3, 1.3.0)
If not, install it:
$ gem install bundler -v "<2" -N
# Install lasted bundler below version 2
# -N: No document
Second, check if you can run that Bundler version:
$ bundle _1.17.3_ -v
You should see:
Bundler version 1.17.3
If you installed Bundler 1.17.3 but cannot run "bundle 1.17.3 -v", there is something wrong with your RubyGems gem. Check if you installed updated version (latest is 3.1.3):
$ gem -v
Try to update the RubyGems gem, because it is the one help you run a specific gem version:
$ gem update --system
You should see:
Updating rubygems-update
...
Installing RubyGems 3.1.3
Successfully built RubyGem
Name: bundler
Version: 2.1.4
File: bundler-2.1.4.gem
Bundler 2.1.4 installed
RubyGems 3.1.3 installed
Regenerating binstubs
...
------------------------------------------------------------------------------
RubyGems installed the following executables:
/home/lqt/.rbenv/versions/2.7.1/bin/gem
/home/lqt/.rbenv/versions/2.7.1/bin/bundle
...
RubyGems system software updated
Check again if you can run a specific Bundler version:
$ bundle _1.17.3_ -v
If you see:
Bundler version 1.17.3
Then, step 3, just run Bundler 1.17.3 to install other gems:
$ bundle _1.17.3_ install
you can try to add this to your Gemfile,
gem 'bundler', '1.17.1'
then try these commands:
gem install bundler -v 1.3.0
gem uninstall bundler -v 2.1.4
bundle update --bundler
bundle install
You can install bundler version 1.3 this way:
gem install bundler -v 1.3
And then use that specific version for installing gems:
bundle _1.3.0_ [install]
Hope that helps!
There was a bug with bundler previously, if you're using the wrong version of ruby gems. Try
gem update --system
I try to install a project I cloned. When I do 'bundle install' I have the following message:
$ bundle install
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.0) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.6.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
So i did the following:
gem uninstall bundler
gem install bundler --version '1.0.0'
Successfully installed bundler-1.0.0
1 gem installed
I do 'bundle install', and I keep having the same message:
$ bundle install
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.0) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.6.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
It seems that I cannot downgrade bundler to the '1.0.0' version, any idea?
If you do not need multiple versions of Bundler, you can uninstall the newer version:
$ gem uninstall bundler -v 1.6.2
You can also choose from a list of bundler versions if you have more than one:
$ gem uninstall bundler
You'll need to hit the global instance (alter installed ruby version as needed) --
$ gem uninstall -i /Users/<user>/.rvm/gems/ruby-2.3.8#global bundler
We recently moved to Rails 4. I have run 'bundle update' (after removing the Gemfile.lock files). I have run into the below problem:
rails s
stops giving the following error message:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
ryp depends on
bundler (< 2.0, >= 1.3.0)
Current Bundler version:
bundler (1.0.15)
But I have checked that the bundler version is 1.3.5 as follows:
bundle version
Bundler version 1.3.5
And tried to uninstall 1.0.15 version as follows:
gem uninstall bundler --version 1.0.15
which results in this message:
INFO: gem "bundler" is not installed
How can I fix the above problem ?
If you're using gemsets, something that's worked for me in the past is uninstalling the version of bundler that is in your global gemset:
rvm gemset use global
gem uninstall bundler
Then switch back to whatever gemset your project uses.
I'm running Ruby 1.9.3 and Rails 4.0.0, and I'm just starting to learn how to use Ruby on Rails. Whenever I type the command to create a project:
rails new blog
I get this error when the bundle tries to execute the "bundle install" command:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.0.0) ruby depends on
bundler (< 2.0, >= 1.3.0) ruby
Current Bundler version:
bundler (1.2.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
But with the command:
gem list bundle
returns:
bundler (1.3.5, 1.2.3)
And the command:
bundle -v
returns:
Bundler version 1.3.5
I don't know why that's happening, I appreciate any help, thanks.
Try removing the version in your Gemfile. Just keep
gem 'bundler'
Now run
bundle update
Try check Gemfile.lock for used bundler version.
You also can try to uninstall old version:
gem uninstall bundler --version 1.2.3
You can also specify the version of bundler you want to use
bundle _1.3.5_ install
I am in an older Rails project that has a Gemfile. I tried to add a gem to the Gemfile and bundle install but got an error:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.0) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.1.5)
This Gemfile requires a different version of Bundler.
The version of Rails it's using requires bundler ~>1.0.0 but I have 1.1.5 installed and am using it for my other projects. Usually I would use bundle exec ... but since this is bundler we are talking about, it's a little more complicated than that. How can I add a gem to my Gemfile and run bundle install while using the version of bundler that it requires?
First you need to install the appropriate version of bundler:
% gem install bundler -v '~> 1.0.0'
Successfully installed bundler-1.0.22
Then force rubygems to use the version you want (see this post):
% bundle _1.0.22_ install
This is what I had to do to get it to work to install with a previous version (2.2.11) of bundler:
gem install bundler:2.2.11
bundle _2.2.11_ install
The error message In Gemfile: bundler (~> 1.16) is a bit inaccurate, since the version number requirement can come from other places, such as the .gemspec file, which was the case for me:
spec.add_development_dependency "bundler", "~> 1.16"
Removing the version number from the .gemspec file solved the issue for me:
spec.add_development_dependency "bundler"
I had the same issue on macOS Mojave. I installed the different version of the bundler gem and uninstall the current version.
gem install bundler -i '2.0.1'
gem uninstall bundler
Then gives me the option to choose the version to uninstall and I choose the one which is creating the problem.
If you use rvm to manage your ruby versions consider using gemsets for projects. This way you can install the specific version of bundler needed without having to specify the version each time.
You can confirm your gemset is loaded by running rvm info in your project directory.
Now you can install the version of bundler you'd like via gem install bundler -v '~> <VERSION>'. The next time you need to use bundler just run bundle.