rails bundler default version not accepting - ruby-on-rails

i m trying to run a rails application is my system but i m facing the issue is bundle version, i tried to install the required version but its not installling that one version and i m not able to remove the default version of bundler . i tried to go into installation_path:/specications/default/
and i remove the default version from this directory but still its showing the latest default version and current version
i m using rails 7.
but project is in lower than 7.
so what should i do?
In Gemfile:
rails (~> 3.2.21) was resolved to 3.2.22.5, which depends on
bundler (~> 1.0)
Current Bundler version:
bundler (2.3.24)
Your bundle requires a different version of Bundler than the one you're running.
Install the necessary version with `gem install bundler:1.17.3` and rerun
bundler using `bundle _1.17.3_ install````

Related

Auto upgrade Gem Versions in GemFile with Rails upgrade

I'm upgrading my Rails application to 5.0 (5.0.0.1 current latest), I've also upgraded my Ruby version to 2.3.0p0 and bundler version to 1.13.6,
Now when I run bundle update it throws error like
devise (= 4.2.0) was resolved to 4.2.0, which depends on
railties (< 5.1, >= 4.1.0)
and so, I'd like to know if there is any automated way to auto update my gem version in gem file since I have around 100 gems in the GemFile
I would go with
$ bundle update
Because if gems you have specified in your Gemfile hasn't specified version, it will update your gems with latest available, and gems which has specified version with '~>' last patched version, for example from 1.0.1 to 1.0.2.
Also note, that bundle install will only install gems or missing gems specified in your gemfile, where bundle update will ugrade all gems managed with bundler.
Final, but that is just my opinion, I would wait with upgrading to Rails 5, just because not all gems are actually tested and upgraded to work with Rails 5.
You can do following things
Delete the GemLock file and do bundle install
OR
Do bundle update
If Still its not fixed
Remove the devise version that you have mentioned in GemFile and so bundle install so that it will automatically pick up the new version

How to change the version of bundler being used in rails?

When I run the following command, it gives me the available installed versions of bundler:
command :
gem list | grep "bundle"
output:
bundler (1.11.2, 1.10.6, 1.10.4, 1.3.6, 1.3.0, 1.3.0.pre)
The current version of bundler I obtained was 1.11.2 using the following command:
bundler --version
I want to use version 1.3.6
How do I swap the current version of bundler with the available ones?
Normally during development Bundler is used from it's executable on your system, so I don't believe you can specify a specific version in your Gemfile, for example. (You might try it, though). However, you can install the version you like and force the shell/rubygems to use that version:
$ gem install bundler -v 1.3.6
...
1 gem installed
$ bundle _1.3.6_ -v
Bundler version 1.3.6
To get my machine to use 1.3.6 by default I had to uninstall 1.11.2.
Update: I tried specifying gem 'bundler', '~> 1.3' in one of my projects and it worked, although the CLI for bundler still used the system default version.
Sept 2019
If you want to upgrade bundler 1 to 2, then you should do the following:
1- The first step in upgrading to Bundler 2 is installing the Bundler 2 gem by running:
gem install bundler
2- When Bundler 2 installed, Bundler will automatically switch between version 1 and version 2 based on your application’s Gemfile.lock based on the BUNDLED WITH ((version)) in your Gemfile.lock
Note:
Before the next step, you should commit your Gemfile & Gemfile.lock, so that you can revert to bundler version 1 if needed
3- To upgrade from bundler 1 to 2, run:
bundle update --bundler
The answer is based on the official bundler update guide
To change your bundler default version, use bundle config default <the desired version>.

execute "vagrant up" from ROR application

I have an ROR application from which I am trying to execute vagrant up command in the following way system("vagrant up")
I am getting the below error
Vagrant experienced a version conflict with some installed plugins!
This usually happens if you recently upgraded Vagrant. As part of the
upgrade process, some existing plugins are no longer compatible with
this version of Vagrant. The recommended way to fix this is to remove
your existing plugins and reinstall them one-by-one. To remove all
plugins:
rm -r ~/.vagrant.d/plugins.json ~/.vagrant.d/gems
Note if you have an alternate VAGRANT_HOME environmental variable
set, the folders above will be in that directory rather than your
user's home directory.
The error message is shown below:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
vagrant (= 1.7.2) x86-mingw32 depends on
bundler (< 1.8.0, >= 1.5.2) x86-mingw32
Current Bundler version:
bundler (1.10.0.pre.2)
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.8.0, >= 1.5.2) x86-mingw32', which is required by gem 'vagrant (= 1.7.2) x86-mingw32', in any of the sources.
I have tried to do gem install bundler , it always installs bundler 1.9.9
If i try to execute vagrant up from command line it works fine
Below are the versions which I am using
ruby -> 2.1.6p336 (2015-04-13 revision 50298) [x64-mingw32]
Vagrant -> 1.7.2
Rails -> 4.2.1
Any sort of help is much appreciated

Trouble installing gems with bundler

I'm new to Rails, following Michael Hartl's textbook. When I run $ bundle install I get the following error:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.1) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.7.6)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
I then try $ gem install bundler which works fine:
Successfully installed bundler-1.7.6
Parsing documentation for bundler-1.7.6
1 gem installed
However, this doesn't solve the problem. I'm sensing this has something to do with version problems, but I'm not sure where to go with it...
The following :
In Gemfile:
rails (= 3.0.1) ruby depends on
bundler (~> 1.0.0) ruby
means the version of bundler required is greater than or equal to 1.0.0 but strictly less than 1.1.0. Rails 3 is depending on an old version of bundler. At this point of time, you should try out Rails 4 instead :)
You may read up more about the "version syntax" in http://guides.rubygems.org/patterns/#pessimistic_version_constraint
As #user3927334 has already stated the error you got is due to a version conflict between bundler and rails.
Most likely you have run rails new my_app with an outdated version of the rails gem.
gem install rails -v 4.2.0.beta4
Can be used to install a particular version of Rails. see Installing Rails.
You should then remove your old app and rerun the app generator:
rails _4.2.0.beta4_ new hello_app
If you indent to develop on your local machine I would recommend installing RVM (Ruby Version Manager) (as did previous versions of MH's Ruby on Rails Tutorial.)
It allows you to effortlessly switch between different versions of ruby and different sets of gems.

Bundler is not self-aware: claims to have version 0.0.1, but is really 1.0.18

EDIT:
I'm an idiot -- I figured out the problem. In a gem I had written a while back, I had VERSION='0.0.1', and for some reason that overrode the version number of bundler.
Won't do that again...
Some background information: on an OS X Lion computer I'm using RVM with Macruby on a Rails 3.0.7 project. I set Macruby and my current gemset to be the default. When I try to run bundle install, I get the following message:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (~> 1.0)
Current Bundler version:
bundler (0.0.1)
Your version of Bundler is older than the one requested by the Gemfile.
Perhaps you need to update Bundler by running `gem install bundler`.
When I run gem list bundle, it shows exactly one installation at version 1.0.18. I suspect that somehow the RVM default setting is not applied all the way through the system. But the system ruby does not have any bundler installed, much less this elusive 0.0.1.
Anybody know what might be going on here?
Could it be possible that your bundle executable is still pointing to an old version of the gem?

Resources