user486421
user486421

Reputation: 849

Is it bug in bundler and rspec?

I'v installed Rails 3.1 new application with some gems:

source 'http://rubygems.org'
gem 'rails', '3.1.1'
gem 'sqlite3', '1.3.4'
group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'unicorn', '4.1.1'
gem execjs, 1.2.9
gem therubyracer, '0.9.9'
gem 'gravatar_image_tag', '1.0.0'
group :test do
  # Pretty printed test output
  gem 'turn', '0.8.3', :require => true
  gem 'rspec-rails', '2.7.0'
  gem 'syntax', '1.0.0'
  gem 'factory_girl_rails', '1.3.0'
end
group :development do
  gem 'webrat', '0.7.3'
  gem 'rspec-rails', '2.7.0'
  gem 'syntax', '1.0.0'
end
group :production do
end

$ bundle exec rails new calculator -T
$ cd calculator
$ bundle exec rails g rspec:install

Create file

require 'spec_helper'

describe PagesController do
  render_views

  before(:each) do
    @base_title = "Calculator Tutorial Application | "
  end

  describe "GET 'home'" do
    it "returns http success" do
      get 'home'
      response.should be_success
    end

    it "should have the right title" do
      get 'home'
      response.should have_selector("title",
                                    :content => @base_title + "Home")
    end
  end
end

and run test

$ ./bin/rspec spec/controllers/pages_controller_spec.rb

/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require': can't convert true into String (TypeError)
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
    from /home/ror/calculator/config/application.rb:13:in `'
    from /home/ror/calculator/config/environment.rb:2:in `require'
    from /home/ror/calculator/config/environment.rb:2:in `'
    from /home/ror/calculator/spec/spec_helper.rb:3:in `require'
    from /home/ror/calculator/spec/spec_helper.rb:3:in `'
    from /home/ror/calculator/spec/controllers/pages_controller_spec.rb:1:in `require'
    from /home/ror/calculator/spec/controllers/pages_controller_spec.rb:1:in `'
    from /home/ror/.gem/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load'
    from /home/ror/.gem/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in load_spec_files'
    from /home/ror/.gem/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
    from /home/ror/.gem/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
    from /home/ror/.gem/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
    from /home/ror/.gem/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
    from /home/ror/.gem/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
    from /home/ror/.gem/ruby/1.9.1/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'

After comment line 13 in ./config/application.rb : # Bundler.require(*Rails.groups(:assets => %w(development test))) Rspec test system works fine, but I have another problem with gravatar_image_tag which works only comment out line Bundle.requre.

All gems are installed over bundler in user home directory.

Upvotes: 1

Views: 412

Answers (1)

deepflame
deepflame

Reputation: 928

Answer from user486421 himself:

Disabling 'turn' gem in Gemfile solved the problem:

gem 'turn', '0.8.3', :require => false

Upvotes: 1

Related Questions