10
votes

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/evolve/Projects/i9/Tornelo/.bundle/environment (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire' from /Users/evolve/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/../mate.rb:10 from /Users/evolve/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/feature_helper.rb:1:in require' from /Users/evolve/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

6
It seems like the Textmate Cucumber bundle is currently lagging on development in the main branch. People seem to be addressing issues as they come up ie Bundler/ Rspec2 /Rails3 / RVM. Anyone else with problems, I suggest checking the github network map and finding recent branches which talk of issues similar to what you are having. github.com/aslakhellesoy/cucumber-tmbundle/networkEvolve

6 Answers

6
votes

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'
2
votes

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.

2
votes

I had a lot of problems getting my CMD-R feature to work, but getting it from the latest master from the Cucumber author, went a long way:

https://github.com/aslakhellesoy/cucumber-tmbundle/tree/

For line 10 in this file:

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

Just comment it out! I didn't have a bundle.environment file anyways. But as written above, definitely change the 'require spec' line if you don't have the Gem. Shame the error messages aren't legible in this thing.

And still! There is no longer any "TM_CUCUMBER_BIN" variable, and it turns out that my environment doesn't like "cucumber #{file_name}", but rather "bundle exec cucumber #{file_name}". (Because I also have functioning Rails 2.3.11 environments installed, is why)

In

~Cucumber.tmbundle/Support/lib/cucumber/mate/runner.rb:

Change line 52 from:

      @output << %Q{Running: #{full_command = "#{RUBY_BIN} #{command} #{@file.rake_task} #{argv.join(' ')}"} \n}

to

      @output << %Q{Running: #{full_command = "bundle exec cucumber #{@file.rake_task} #{argv.join(' ')}"} \n}

One more thing! I have my feature files nested in various subdirectories, so it had no idea where to pull my step definitions from, despite the fact that a Dir.chdir() is called. So I had to add

TM_CUCUMBER_OPTS=-r my_features_dir --format=html

to the Preferences=>Advanced=>ShellVariables settings in TextMate.

1
votes

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.

1
votes

I had the same problem and solved it by following these steps :

> mate ~/Library/Application\ Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate.rb

Comment or Remove line 20 (or whatever line the error message says) :

> #require 'spec'
0
votes

It seems like the Textmate Cucumber bundle is currently lagging on development in the main branch. People seem to be addressing issues as they come up ie Bundler/ Rspec2 /Rails3 / RVM.

Anyone else with problems, I suggest checking the github network map and finding recent branches which talk of issues similar to what you are having.

https://github.com/aslakhellesoy/cucumber-tmbundle/network