views:

83

answers:

3

From a cucumber feature file when I go to 'Run features' Im getting the error below in the popup box that appears.

How do I fix this?


/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- /Users/richie/Projects/i9/Tornelo/.bundle/environment (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire' from /Users/richie/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/../mate.rb:10 from /Users/richie/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/feature_helper.rb:1:in require' from /Users/richie/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/feature_helper.rb:1 from /tmp/cucumber-906.rb:2:inrequire' from /tmp/cucumber-906.rb:2

A: 

This has happened to me since I loaded rvm and gone through the steps listed under packages for textmate. Now, when I 'run feature' for a cucumber feature from within textmate I get an error '.bundle/environment no such file to load'. I don't have a .bundle/environment.rb so I created an empty one and the feature gets run but the environment.rb file gets deleted every time! (Making me very keen to see this fixed!) If you have any feedback to add to your post I'd be very interested to hear it.

Since I posted this, I've reloaded the Textmate cucumber bundle and the problem has gone away. Beware though - the installation instructions are incorrect - they should read

mkdir -p ~/Library/Application\ Support/TextMate/Bundles/
cd ~/Library/Application\ Support/TextMate/Bundles
rm -rf Cucumber.tmbundle
git clone http://github.com/drnic/cucumber-tmbundle Cucumber.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'

You don't need the 'rm -rf Cucumber.tmbundle' line if this is a first install. No editing of files needed! You will be able to update from within textmate once you have done this.

+1  A: 

Codeape has forked and updated the bundle. I applied a hack myself with a little help from some guru's.

Try this: github.com/codeape/cucumber-tmbundle

Let me know how it goes user241560.

Evolve
+2  A: 

I had the same error. To fix it you need to edited this file:

/Users/richie/Library/Application Support/TextMate/Pristine Copy/Bundles/Cucumber.tmbundle/Support/lib/cucumber

Replace line 10 with the following 2 lines:

environment_file = File.join(ENV['TM_PROJECT_DIRECTORY'], bundle_path, "environment")
require "#{enviroment_file}" if File.exists?("#{environment_file}.rb")

That way it only loads the file if it exists.

I'm using RSpec 2.0 so I also had to modify the rspec require at line 23 (now line 24) to read:

require 'rspec'
Mike Bethany