stack1
stack1

Reputation: 1022

Using Bundler with RVM

I am just trying to learn Rspec. For that, I had to make a VM with ubuntu linux 14.10. I installed RVM and made 1.9.3 my default. Now, I am trying to install the following gems using the gem - Bundler. I could install each gem using the gem install command too. But, I want to use Bundler instead because its well organized.

Q1 - Will all the installations made via Bundler go through RVM or will they be bypassed ? If yes, then I'll have to do it manually.

Here is my file named Gemlock -

source 'http://rubygems.org'

# gem 'ruby','1.8.7'
gem 'rubygems', '1.3.7'
gem 'rspec', '2.0.0'
gem 'rspec-rails', '2.0.0'
gem 'cucumber', '0.9.2'
gem 'cucumber-rails', '0.3.2'
gem 'database_cleaner', '0.5.2'
gem 'webrat', '0.7.2'
gem 'selenium-client', '1.2.18'
gem 'rails', '3.0.0'

Here is the output of various runs of Bundle install -

john@ubuntu:~/Code/Rspec$ bundle install
Fetching gem metadata from http://rubygems.org/.........
Resolving dependencies...
Could not find gem 'rubygems (= 1.3.7) ruby' in the gems available on this machine.
john@ubuntu:~/Code/Rspec$ bundle install --full-index
Fetching source index from https://rubygems.org/
Resolving dependencies...
Could not find gem 'rubygems (= 1.3.7) ruby' in the gems available on this machine.
john@ubuntu:~/Code/Rspec$ bundle install --full-index
Fetching source index from http://rubygems.org/
Resolving dependencies...
Could not find gem 'rubygems (= 1.3.7) ruby' in the gems available on this machine.
john@ubuntu:~/Code/Rspec$

I saw some posts on Stack overflow which told me to use http instead of https in the gemsource. Failed ! I also tried bundle install --full-index. Failed.

Q2 - What is the meaning of this error - There is no rubygems 1.3.7 on this system ? That is why I am trying to install it !

Please help me to fix this problem.

When I try to install rubygems 1.3.7 manually, I get -

john@ubuntu:~/Code/Rspec$ gem install rubygems -v 1.3.7
ERROR:  Could not find a valid gem 'rubygems' (= 1.3.7) in any repository
ERROR:  Possible alternatives: ruby_gem, rubydeps, ruby-rets, rubyless, rubyjams

UPDATE:

I commented the rubygems line in my bundler code and got the error -

john@ubuntu:~/Code/Rspec$ bundle install
Fetching gem metadata from http://rubygems.org/.........
Resolving dependencies...
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.7.9)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
john@ubuntu:~/Code/Rspec$ 

Upvotes: 0

Views: 392

Answers (1)

nathanvda
nathanvda

Reputation: 50057

Remove the gem 'rubygems' line from the Gemfile. There is no need for that.

Upvotes: 1

Related Questions