bundle install failed - ruby-on-rails

I am getting this error on bundle install
Gem::InstallError: devise_invitable requires RubyGems version ~> 1.3.6. Try 'gem update --system' to update RubyGems itself.
An error occured while installing devise_invitable (0.4.rc), and Bundler cannot continue.
Make sure that `gem install devise_invitable -v '0.4.rc'` succeeds before bundling.
but when i see the version of rubygems i have
gem -v
1.8.10
any ideas on how to fix this....here is the top of my gemfile
gem 'rails', '3.0.3'
gem 'devise', "1.2.rc"
gem 'devise_invitable', '0.4.rc'

In the gemspec for devise_invitable, they explicitly require rubygems, ruby and bundler with specific version constraints. While they look like they should be ok since they are using >=, the fact that it comes out in your console as ~> is telling.
The requirement of ~> 1.3.6 means you need to have a version of rubygems installed that is 1.3.6 <= x < 1.4.0.
You could try running bundle install to get compatible gem versions
But if that doesn't work, try installing the version explicitly gem install rubygems -v 1.3.6

Related

bundler version issue in rails 4?

I am getting this bundler error how do i resolve it.
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.2.11.3) was resolved to 4.2.11.3, which depends on
bundler (>= 1.3.0, < 2.0)
Current Bundler version:
bundler (2.3.12)
Your bundle requires a different version of Bundler than the one you're running.
Install the necessary version with `gem install bundler:2.0.0.pre.3` and rerun bundler using `bundle _2.0.0.pre.3_`
What do gem install bundler:2.0.0.pre.3 and bundle _2.0.0.pre.3_ command gonna do. Are they gonna replace my 2.3.12 and install 2.0.0
There can be multiple versions of the same gem installed in your gemset. Run this:
gem install bundler:2.0.0.pre.3
and then run this:
gem info bundler
you will find two versions of the gem installed. By default, it will run bundle with the latest version but as your gems are not compatible with it you can run bundle with a different version of the gem. To do that you need to run:
bundle _version_
in your case it will be:
bundle _2.0.0.pre.3_
You can also remove the other versions of the bundler gem and just keep the one that is compatible. To remove a specific version you could do:
gem uninstall bundler:2.3.12

Error While installing rails, i18n requires Ruby version >= 1.9.3 [duplicate]

How can I correct this "i18n requires Ruby version >= 1.9.3" I get when I run "bundler install"?
Background: Need to use ruby 1.8.7 on dreamhost, so have targeted Rails v3.2 for this.
Command Line
Gregs-MacBook-Pro:weekends Greg$ ruby -v
ruby 1.8.7 (2013-12-22 patchlevel 375) [i686-darwin14.1.0]
Gregs-MacBook-Pro:weekends Greg$ bundler -v
Bundler version 1.9.2
Gregs-MacBook-Pro:weekends Greg$ bundler install
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies............
Using rake 10.4.2
Gem::InstallError: i18n requires Ruby version >= 1.9.3.
An error occurred while installing i18n (0.7.0), and Bundler cannot continue.
Make sure that `gem install i18n -v '0.7.0'` succeeds before bundling.
Gregs-MacBook-Pro:weekends Greg$
Gregs-MacBook-Pro:weekends Greg$ gem install i18n -v '0.7.0'
ERROR: Error installing i18n:
i18n requires Ruby version >= 1.9.3.
Gem File
gem 'rails', '3.2' # Dreamhost is Ruby 1.8.7. Rails 3.2 requires at least Ruby 1.8.7
gem 'sqlite3'
gem 'haml'
gem 'haml-rails'
gem 'omniauth-google-oauth2'
gem 'google-api-client', :require => 'google/api_client'
gem 'jquery-rails'
gem 'figaro'
gem 'rest-client'
You could try to downgrade I18n's version to 0.6.11, because that seems to be the latest version that does not require Ruby 1.9.3. To do so add this to your Gemfile
gem 'i18n', '0.6.11'
and try to run bundle install again.
Furthermore, I suggest upgrading your Ruby and Rails versions. They are both outdated. At least you could try to run Rails 3.2 with a version of Ruby that allows the new syntax. Otherwise, you will face this kind of problems with many other gems too and - more important - you will not be able to install all the security fixes there were released during the last years.

How to unlock Nokogiri version on Ubuntu

I am trying to install the aws-sdk gem for Rails, but it requires a Nokogiri version less than 1.6.0. I think due to a previous bundle install my system is locked on Nokogiri v1.6.6.2.
I tried removing the locked gem, and ran a bundle update but it didn't work. What should I do?
Specify your desired Nokogiri version in your Gemfile:
gem 'nokogiri', '< 1.6.0'
and run
bundle update nokogiri
Run
gem uninstall nokogiri -v 1.6.6.2
then change the Gemfile to the version you want and then do a bundle install.

bundler install getting "i18n requires Ruby version >= 1.9.3"

How can I correct this "i18n requires Ruby version >= 1.9.3" I get when I run "bundler install"?
Background: Need to use ruby 1.8.7 on dreamhost, so have targeted Rails v3.2 for this.
Command Line
Gregs-MacBook-Pro:weekends Greg$ ruby -v
ruby 1.8.7 (2013-12-22 patchlevel 375) [i686-darwin14.1.0]
Gregs-MacBook-Pro:weekends Greg$ bundler -v
Bundler version 1.9.2
Gregs-MacBook-Pro:weekends Greg$ bundler install
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies............
Using rake 10.4.2
Gem::InstallError: i18n requires Ruby version >= 1.9.3.
An error occurred while installing i18n (0.7.0), and Bundler cannot continue.
Make sure that `gem install i18n -v '0.7.0'` succeeds before bundling.
Gregs-MacBook-Pro:weekends Greg$
Gregs-MacBook-Pro:weekends Greg$ gem install i18n -v '0.7.0'
ERROR: Error installing i18n:
i18n requires Ruby version >= 1.9.3.
Gem File
gem 'rails', '3.2' # Dreamhost is Ruby 1.8.7. Rails 3.2 requires at least Ruby 1.8.7
gem 'sqlite3'
gem 'haml'
gem 'haml-rails'
gem 'omniauth-google-oauth2'
gem 'google-api-client', :require => 'google/api_client'
gem 'jquery-rails'
gem 'figaro'
gem 'rest-client'
You could try to downgrade I18n's version to 0.6.11, because that seems to be the latest version that does not require Ruby 1.9.3. To do so add this to your Gemfile
gem 'i18n', '0.6.11'
and try to run bundle install again.
Furthermore, I suggest upgrading your Ruby and Rails versions. They are both outdated. At least you could try to run Rails 3.2 with a version of Ruby that allows the new syntax. Otherwise, you will face this kind of problems with many other gems too and - more important - you will not be able to install all the security fixes there were released during the last years.

How to `bundle install` when your Gemfile requires an older version of bundler?

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.

Resources