08 Oct 2012, 16:02
Craig_pragsmall

Craig Despeaux (2 posts)

I am following the book on ubuntu 12.04.1 and have installed ruby 1.9.3 using rvm.

cdespeau@ced-ubuntu:~/calculator$ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

cdespeau@ced-ubuntu:~/calculator$ cat Gemfile source :rubygems

gem ‘sinatra’, ‘1.3.2’ gem ‘service_manager’, ‘0.6.4’ gem ‘activerecord’, ‘3.2.7’ gem ‘sqlite3’, ‘1.3.6’

group :development do gem ‘rspec’, ‘2.11.0’ gem ‘cucumber’, ‘1.2.1’ gem ‘capybara’, ‘2.0.0.beta2’ gem ‘launchy’, ‘2.1.0’ end

group :test do gem ‘cucumber’, ‘1.2.1’ gem ‘rspec-expectations’, ‘2.11.2’ end

I’m on page 177 in Chapter 10 where I add activerecord and sqlite3 gems to my Gemfile (shown above) and run bundle install. It complains as follows:

cdespeau@ced-ubuntu:~/calculator$ bundle install Fetching gem metadata from http://rubygems.org/…….. Bundler could not find compatible versions for gem “builder”: In Gemfile: activerecord (= 3.2.7) ruby depends on builder (~> 3.0.0) ruby

cucumber (= 1.2.1) ruby depends on
  builder (3.1.3)

I tried removing the versions for activerecord and cucumber which causes bundle install to complete successfully, however when I run cucumber I see a slew of errors:

cdespeau@ced-ubuntu:~/calculator$ bundle install Using activesupport (2.3.14) Using activerecord (2.3.14) Using addressable (2.2.8) Using background_process (1.3) Using builder (3.1.3) Using mime-types (1.19) Using nokogiri (1.5.5) Using rack (1.4.1) Using rack-test (0.6.2) Using ffi (1.1.5) Using childprocess (0.3.5) Using libwebsocket (0.1.5) Using multi_json (1.3.6) Using rubyzip (0.9.9) Using selenium-webdriver (2.25.0) Using xpath (1.0.0.beta1) Using capybara (2.0.0.beta2) Using diff-lcs (1.1.3) Using json (1.7.5) Using gherkin (2.11.2) Using cucumber (1.2.1) Using launchy (2.1.0) Using rack-protection (1.2.0) Using rspec-core (2.11.1) Using rspec-expectations (2.11.2) Using rspec-mocks (2.11.3) Using rspec (2.11.0) Using tcpsocket-wait (1.0.0) Using service_manager (0.6.4) Using tilt (1.3.3) Using sinatra (1.3.2) Using sqlite3 (1.3.6) Using bundler (1.2.1) Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.

cdespeau@ced-ubuntu:~/calculator$ cucumber features/cash_withdrawal.feature /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3:in <top (required)>': iconv will be deprecated in the future, use String#encode instead. undefined method info’ for nil:NilClass (NoMethodError) /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:478:in block in migrate' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in each’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in migrate' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:401:in up’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:383:in migrate' /home/cdespeau/calculator/lib/account.rb:4:in <top (required)>’ /home/cdespeau/calculator/lib/nice_bank.rb:2:in require_relative' /home/cdespeau/calculator/lib/nice_bank.rb:2:in <top (required)>’ /home/cdespeau/calculator/features/support/env.rb:1:in require' /home/cdespeau/calculator/features/support/env.rb:1:in <top (required)>’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in load' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in load_code_file’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:in load_file' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in block in load_files!’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in each' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in load_files!’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:in load_step_definitions' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in run!’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in execute!' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in execute’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.1/bin/cucumber:14:in <top (required)>' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/bin/cucumber:19:in load’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/bin/cucumber:19:in <main>' /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in eval’ /home/cdespeau/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `'

Any ideas as to how I resolve these errors?

Thanks, Craig

08 Oct 2012, 17:45
Craig_pragsmall

Craig Despeaux (2 posts)

I dropped the cucumber version back to ‘1.2.0’ and that seems to have resolved the issue on both counts (bundler as well as cucumber execution). I am progressing again. BTW. I am using the P2.0 August 2012 version of the book.

  You must be logged in to comment