# No such file to load -- spec/story (LoadError)

**URL:** <https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645>\
**Category:** IronRuby\
**Created:** [November 25, 2010, 4:18pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645 "2010-11-25T16:18:38Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 25, 2010, 4:18pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/1 "2010-11-25T16:18:38Z")

</div>

Hi Guys,

I’m trying to run the following script:

require ‘rubygems’  
require ‘spec/story’

steps\_for(:product\_x) do  
Given(“Product $productName at $price”) do |productName, price|  
pending “Need to complete implementation for accessing C# object”  
end  
When(“user requests a $amount user license”) do |amount|  
pending “Need to complete implementation for accessing C# object”  
end  
When(“this does not include support”) do  
pending “Need to complete implementation for accessing C# object”  
end  
Then(“the price should be $price”) do |price|  
pending “Need to complete implementation for accessing C# object”  
end  
end

with\_steps\_for(:product\_x) do  
run File.dirname( **FILE** ) + “/pricing\_scenarios\_for\_product\_x”  
end

And I get this error:

C:/Program Files/IronRuby  
1.0/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:  
31:in `require': no such file to load -- spec/story (LoadError) from C:/Program Files/IronRuby 1.0/lib/ruby/site_ruby/1.8/rubygems/custo m_require.rb:31:in`require’  
from pricing\_scenarios\_for\_product\_x\_story.rb:2

Any ideas of what I’m doing wrong?

Thanks for any attention.

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 26, 2010, 10:38pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/2 "2010-11-26T22:38:16Z")

</div>

script/generate is for rspec-rails (which is a rails plug-in).

I seems like you’re not testing a rails app, so you need to install the  
rspec gem in order to use it. Have you done that?

Shay.

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 26, 2010, 10:58pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/3 "2010-11-26T22:58:18Z")

</div>

Hi Sundae,

generate is a ruby command in the script folder of a Rails app. Unless  
you are working in a Rails app, it won’t be available.

If you _are_ working in a Rails app, but on a Windows machine, then  
trying running “ir script/generate rspec”. I think that’s right. I know  
in Ruby it would be “ruby script/generate rspec”. You are telling the  
interpreter to execute the file “generate” in the folder called “script”  
passing the argument “rspec” to it.

Have you installed rspec in your gems?

Cory

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 26, 2010, 8:15pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/4 "2010-11-26T20:15:24Z")

</div>

I stumbled on this link…very similar to the problem I’m having

[http://old.nabble.com/New-setup-error.-no-such-file-to-load----spec-story-td23590218.html](http://old.nabble.com/New-setup-error.-no-such-file-to-load----spec-story-td23590218.html)

They suggest to run this: script/generate rspec

how do I run it? When I paste it Ironruby command prompt I get the  
following message:

‘script’ is not recognized as an internal or external command,  
operable program or batch file.

Anybody ?

Sundae Oliseh wrote in post #963907:

> Hi Guys,
> 
> I’m trying to run the following script:
> 
> require ‘rubygems’  
> require ‘spec/story’
> 
> steps\_for(:product\_x) do  
> Given(“Product $productName at $price”) do |productName, price|  
> pending “Need to complete implementation for accessing C# object”  
> end  
> When(“user requests a $amount user license”) do |amount|  
> pending “Need to complete implementation for accessing C# object”  
> end  
> When(“this does not include support”) do  
> pending “Need to complete implementation for accessing C# object”  
> end  
> Then(“the price should be $price”) do |price|  
> pending “Need to complete implementation for accessing C# object”  
> end  
> end
> 
> with\_steps\_for(:product\_x) do  
> run File.dirname( **FILE** ) + “/pricing\_scenarios\_for\_product\_x”  
> end
> 
> And I get this error:
> 
> C:/Program Files/IronRuby  
> 1.0/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:  
> 31:in `require': no such file to load -- spec/story (LoadError) from C:/Program Files/IronRuby 1.0/lib/ruby/site_ruby/1.8/rubygems/custo m_require.rb:31:in `require’  
> from pricing\_scenarios\_for\_product\_x\_story.rb:2
> 
> Any ideas of what I’m doing wrong?
> 
> Thanks for any attention.

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 27, 2010, 1:49am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/5 "2010-11-27T01:49:05Z")

</div>

Hi Sundae,

Are you running this from a tutorial? If I remember correctly,  
spec/story was the old StoryRunner for RSpec, which was deprecated since  
most everyone uses Cucumber for Story Writing. Do you have the link to  
the tutorial you are using?

Cory

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 26, 2010, 11:19pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/6 "2010-11-26T23:19:43Z")

</div>

Thanks for the replies guys.

Indeed I’m _not_ testing a rails application.

I have installed rspec.

here’s the output from the installation:

C:\IronRuby\bin\>igem install rspec

* * *

Thank you for installing rspec-core-2.1.0

Please be sure to look at the upgrade instructions to see what might  
have  
changed since the last release:

[http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown](http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown)

* * *

Successfully installed rspec-core-2.1.0  
Successfully installed diff-lcs-1.1.2  
Successfully installed rspec-expectations-2.1.0  
Successfully installed rspec-mocks-2.1.0  
Successfully installed rspec-2.1.0  
5 gems installed  
Installing ri documentation for rspec-core-2.1.0…  
Installing ri documentation for diff-lcs-1.1.2…  
Installing ri documentation for rspec-expectations-2.1.0…  
Installing ri documentation for rspec-mocks-2.1.0…  
Installing ri documentation for rspec-2.1.0…  
Installing RDoc documentation for rspec-core-2.1.0…  
Installing RDoc documentation for diff-lcs-1.1.2…  
Installing RDoc documentation for rspec-expectations-2.1.0…  
Installing RDoc documentation for rspec-mocks-2.1.0…  
Installing RDoc documentation for rspec-2.1.0…

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 27, 2010, 2:04am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/7 "2010-11-27T02:04:03Z")

</div>

Hi Cory,

That’s an excellent question.  
As I am an absolute newbie in Ironruby, I’m using these two articles as  
starting point

> **[.NET Interop - Getting Started With IronRuby And RSpec, Part 1](https://learn.microsoft.com/en-us/archive/msdn-magazine/2009/february/net-interop-getting-started-with-ironruby-and-rspec-part-1)**

> **[.NET Interop: Automate Acceptance Testing With IronRuby](https://learn.microsoft.com/en-us/archive/msdn-magazine/2009/march/net-interop-automate-acceptance-testing-with-ironruby)**

Maybe they’re outdated.

Cory F. wrote in post #964185:

> Hi Sundae,
> 
> Are you running this from a tutorial? If I remember correctly,  
> spec/story was the old StoryRunner for RSpec, which was deprecated since  
> most everyone uses Cucumber for Story Writing. Do you have the link to  
> the tutorial you are using?
> 
> Cory

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 27, 2010, 12:41pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/8 "2010-11-27T12:41:55Z")

</div>

Hi Sundae,

The articles in MSDN magazine are a little out dated. What versions on  
IronRuby are you running? You can type in ir -v to get the version. I  
remember struggling with these articles when I first started out. I’d  
be  
happy to give you a hand.

Mike

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 29, 2010, 4:38pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/9 "2010-11-29T16:38:09Z")

</div>

Hi Cory,

I was suspecting that something was not quite right with RSPEC. I Will  
take a look at Cucumber instead.  
I will definitely pick up a copy of that book.

Thanks for the recommendation.

Cory F. wrote in post #964205:

> Hi Sundae,
> 
> Indeed they are. You want to be looking at Cucumber instead of RSpec for  
> Story support.
> 
> I’d highly recommend David’s book (which I believe has finally shipped!)  
> [http://www.pragprog.com/titles/achbd/the-rspec-book](http://www.pragprog.com/titles/achbd/the-rspec-book). It’s not about  
> using BDD with IronRuby, but the concepts are still important.
> 
> I’m not sure what the latest scoop is for Cucumber and IronRuby, but it  
> looks like Shay recently answered a question around it on the Ruby list  
> ([http://www.ruby-forum.com/topic/216286](http://www.ruby-forum.com/topic/216286)) so he might chime in soon with  
> more info for that. But they pointed to the following article  
> ([http://blog.webintellix.com/2009/10/how-to-use-cucumber-with-net-and-c.html](http://blog.webintellix.com/2009/10/how-to-use-cucumber-with-net-and-c.html))  
> which is over a year old now, but I’m assuming still works.
> 
> Cory

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 29, 2010, 4:45pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/10 "2010-11-29T16:45:31Z")

</div>

I’m running IronRuby 1.0.0.0 on .NET 2.0.50727.3615 Mike.

Mike Hatfield wrote in post #964264:

> Hi Sundae,
> 
> The articles in MSDN magazine are a little out dated. What versions on  
> IronRuby are you running? You can type in ir -v to get the version. I  
> remember struggling with these articles when I first started out. I’d  
> be  
> happy to give you a hand.
> 
> Mike

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 27, 2010, 5:19am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/11 "2010-11-27T05:19:37Z")

</div>

Hi Sundae,

Indeed they are. You want to be looking at Cucumber instead of RSpec for  
Story support.

I’d highly recommend David’s book (which I believe has finally shipped!)  
[Pragmatic Bookshelf: By Developers, For Developers](http://www.pragprog.com/titles/achbd/the-rspec-book). It’s not about  
using BDD with IronRuby, but the concepts are still important.

I’m not sure what the latest scoop is for Cucumber and IronRuby, but it  
looks like Shay recently answered a question around it on the Ruby list  
([IronRuby and Cucumber - IronRuby - Ruby-Forum](http://www.ruby-forum.com/topic/216286)) so he might chime in soon with  
more info for that. But they pointed to the following article  
([Webintellix.com](http://blog.webintellix.com/2009/10/how-to-use-cucumber-with-net-and-c.html))  
which is over a year old now, but I’m assuming still works.

Cory

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 29, 2010, 5:59pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/12 "2010-11-29T17:59:12Z")

</div>

I am currently following this tutorial:

[http://blog.webintellix.com/2009/10/how-to-use-cucumber-with-net-and-c.html](http://blog.webintellix.com/2009/10/how-to-use-cucumber-with-net-and-c.html)

and I’m stuck on step 4 with the following error:

C:\Ruby192\bin\>icucumber -help  
c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/gherkin/native  
/ikvm.rb:16:in `load_assembly': Assembly 'gherkin' not found\nTry this: SET MONO _PATH=c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib (or expo rt MONO_PATH=...) (LoadError) from c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/g herkin/native/ikvm.rb:16:in `native\_impl’  
from  
c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/g  
herkin/i18n.rb:7  
from  
C:/IronRuby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require' from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’  
from  
c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/g  
herkin/lexer/i18n\_lexer.rb:1  
from  
C:/IronRuby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require' from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’  
from  
c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/g  
herkin.rb:1  
from  
C:/IronRuby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require' from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’  
from  
c:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-0.9.4/bin/../lib/cucum  
ber/cli/main.rb:5  
from  
C:/IronRuby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require' from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’  
from  
c:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-0.9.4/bin/cucumber:5  
from C:/Ruby192/bin/cucumber:19:in `load’  
from C:/Ruby192/bin/cucumber:19

Sundae Oliseh wrote in post #964772:

> I’m running IronRuby 1.0.0.0 on .NET 2.0.50727.3615 Mike.
> 
> Mike Hatfield wrote in post #964264:
> 
> > Hi Sundae,
> > 
> > The articles in MSDN magazine are a little out dated. What versions on  
> > IronRuby are you running? You can type in ir -v to get the version. I  
> > remember struggling with these articles when I first started out. I’d  
> > be  
> > happy to give you a hand.
> > 
> > Mike

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 29, 2010, 8:51pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/13 "2010-11-29T20:51:04Z")

</div>

It seems that Cucumber for IronRuby is a little broken at the moment.  
There’s an issue with Gherkin (the bdd language used by Cucumber and  
SpecFlow).

To get around this, I installed an older version of Cucumber that did  
not  
have this dependency.

I installed Cucumber 1.6.4 with the command:  
igem install cucumber -v=1.6.4

It needed iron-term-ansicolor, I installed that with:  
igem install iron-term-ansicolor

To get Cucumber to run with IronRuby, I created a batch file in the  
IronRuby  
bin folder called icucumber.bat. My bat file looks like:  
@ECHO OFF  
REM This is to tell IronRuby where to find gems.  
SET  
GEM\_PATH=C:\Users\mike.hatfield.NICOM.pik\rubies\IronRuby-10v4\lib\ironruby\gems\1.8  
@“C:\Users\mike.hatfield.NICOM.pik\rubies\IronRuby-10v4\bin\ir.exe”  
“C:\Users\mike.hatfield.NICOM.pik\rubies\IronRuby-10v4\bin\cucumber” %\*

Your batch file’s GEM\_PATH and executable paths are probably different  
than  
mine, I’m running IronRuby with PIK (allows me to run multiple versions  
of  
Ruby).

I then started the feature from the MSDN article. I had to change  
“Story:”  
to “Feature:”. My story is:  
Feature: Pricing for New Product X  
As a sales administrator, I want to be able to view  
prices for product x so that I can provide customers  
with an accurate cost for their requirements.

Scenario: Single User License for Product X without support  
Given Product X  
When user requests a 1 user license  
And this does not include support  
Then the price should be $250

I called this file story.feature and saved it in a folder called  
features.

If you run the following cucumber command, you should get the initial  
cucumber story run.  
icucumber features

This gives you a list of steps (When clauses) that need to be  
implemented in  
your step definitions to make the story pass.

Inside the features folder I created another folder called  
step\_definitons.  
Inside the step\_definitons folder, I created a file called  
product\_steps.rb

Now, for the .NET class library. I created three class files:  
_Product.cs_  
namespace Bdd.Store  
{  
public class Product  
{  
public string Name { get; set; }  
public double Price { get; set; }  
}  
}

_Store.cs_  
namespace Bdd.Store  
{  
public class Store  
{  
public Product FindByProductName(string name)  
{  
Product product = new Product { Name = name };  
return product;  
}  
}  
}

_Purchase.cs_  
namespace Bdd.Store  
{  
public class Purchase  
{  
public Product Product{ get; set; }  
public int Licenses { get; set; }  
public bool IncludesSupport { get; set; }  
public double GetTotalPurchasePrice()  
{  
double price = Product.Price \* Licenses;  
double supportFees = 0.0;  
if(IncludesSupport)  
{  
supportFees = price \* 0.10;  
}

```
  return price + supportFees;
}

```

}  
}

I then compiled these into an assembly called Product.dll using the  
CSharp  
compiler command (run from my Visual Studio Command window):  
csc /out:Product.dll /target:library Product.cs Store.cs Purchase.cs

I then required my Product.dll into my step definitions file (  
product\_steps.rb)  
require File.dirname( **FILE** ) + “/Product.dll”

Just as a convenience, I “include” my Bdd.Store namespace:  
include Bdd::Store

I also require RSepc  
require “rspec”

Lastly, I begin implementing my steps:  
Given /^Product (.\*)$/ do |product|  
@store = Store.new  
@product = @store.find\_by\_product\_name(product)  
@product.price = 250;  
@product.name.should == product  
end

and so on and so forth. You can download my files from  
[http://webcoding4fun.oakraven.net/downloads/BDD](http://webcoding4fun.oakraven.net/downloads/BDD)  
Example with CSharp.zip I hope this helps a little.

Mike

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 29, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/14 "2010-11-29T21:30:11Z")

</div>

Thanks for your very detailled example Mike.  
I’ve run into some issues while following it:

when I run the following statement: igem install cucumber -v=1.6.4  
here’s the error message I received:

C:\IronRuby\bin\>igem install cucumber -v=1.6.4  
ERROR: could not find gem cucumber locally or in a repository

I searched around the net a little bit and found out that there is an  
alternative syntax:

C:\IronRuby\bin\>igem install --source [http://gems.rubyforge.org](http://gems.rubyforge.org) cucumber

- v1.6.4

I ran it and got the follwing output

(:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂  
(:🙂

Thank you for installing cucumber-0.9.4.  
Please be sure to read  
[http://wiki.github.com/aslakhellesoy/cucumber/upgrading](http://wiki.github.com/aslakhellesoy/cucumber/upgrading)  
for important information about this release. Happy cuking!

(:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂 (:🙂  
(:🙂

Successfully installed cucumber-0.9.4  
ERROR: could not find gem v1.6.4 locally or in a repository  
1 gem installed  
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rdoc-2.5.11/lib/rdoc/ruby\_lex.rb:67:  
warning  
: parenthesize argument(s) for future version  
Installing ri documentation for cucumber-0.9.4…  
Installing RDoc documentation for cucumber-0.9.4…

As you can see, there is an error message in there. It did not  
ultimately install the correct version

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 29, 2010, 10:12pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/15 "2010-11-29T22:12:41Z")

</div>

Do these problems manifest when using IronRuby 1.1.2? (master from  
github). Could you file a bug with details if so?

Thanks,  
Tomas

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Mike Hatfield  
Sent: Monday, November 29, 2010 11:16 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] no such file to load – spec/story  
(LoadError)

It seems that Cucumber for IronRuby is a little broken at the moment.  
There’s an issue with Gherkin (the bdd language used by Cucumber and  
SpecFlow).

To get around this, I installed an older version of Cucumber that did  
not have this dependency.

I installed Cucumber 1.6.4 with the command:  
igem install cucumber -v=1.6.4

It needed iron-term-ansicolor, I installed that with:  
igem install iron-term-ansicolor

To get Cucumber to run with IronRuby, I created a batch file in the  
IronRuby bin folder called icucumber.bat. My bat file looks like:  
@ECHO OFF  
REM This is to tell IronRuby where to find gems.  
SET  
GEM\_PATH=C:\Users\mike.hatfield.NICOM.pik\rubies\IronRuby-10v4\lib\ironruby\gems\1.8  
@“C:\Users\mike.hatfield.NICOM.pik\rubies\IronRuby-10v4\bin\ir.exe”  
“C:\Users\mike.hatfield.NICOM.pik\rubies\IronRuby-10v4\bin\cucumber” %\*

Your batch file’s GEM\_PATH and executable paths are probably different  
than mine, I’m running IronRuby with PIK (allows me to run multiple  
versions of Ruby).

I then started the feature from the MSDN article. I had to change  
“Story:” to “Feature:”. My story is:  
Feature: Pricing for New Product X  
As a sales administrator, I want to be able to view  
prices for product x so that I can provide customers  
with an accurate cost for their requirements.

Scenario: Single User License for Product X without support  
Given Product X  
When user requests a 1 user license  
And this does not include support  
Then the price should be $250

I called this file story.feature and saved it in a folder called  
features.

If you run the following cucumber command, you should get the initial  
cucumber story run.  
icucumber features

This gives you a list of steps (When clauses) that need to be  
implemented in your step definitions to make the story pass.

Inside the features folder I created another folder called  
step\_definitons. Inside the step\_definitons folder, I created a file  
called product\_steps.rb

Now, for the .NET class library. I created three class files:  
Product.cs  
namespace Bdd.Store  
{  
public class Product  
{  
public string Name { get; set; }  
public double Price { get; set; }  
}  
}

Store.cs  
namespace Bdd.Store  
{  
public class Store  
{  
public Product FindByProductName(string name)  
{  
Product product = new Product { Name = name };  
return product;  
}  
}  
}

Purchase.cs  
namespace Bdd.Store  
{  
public class Purchase  
{  
public Product Product{ get; set; }  
public int Licenses { get; set; }  
public bool IncludesSupport { get; set; }  
public double GetTotalPurchasePrice()  
{  
double price = Product.Price \* Licenses;  
double supportFees = 0.0;  
if(IncludesSupport)  
{  
supportFees = price \* 0.10;  
}

```
  return price + supportFees;
}

```

}  
}

I then compiled these into an assembly called Product.dll using the  
CSharp compiler command (run from my Visual Studio Command window):  
csc /out:Product.dll /target:library Product.cs Store.cs Purchase.cs

I then required my Product.dll into my step definitions file  
(product\_steps.rb)  
require File.dirname( **FILE** ) + “/Product.dll”

Just as a convenience, I “include” my Bdd.Store namespace:  
include Bdd::Store

I also require RSepc  
require “rspec”

Lastly, I begin implementing my steps:  
Given /^Product (.\*)$/ do |product|  
@store = Store.new  
@product = @store.find\_by\_product\_name(product)  
@product.price = 250;  
@product.name.should == product  
end

and so on and so forth. You can download my files from  
[http://webcoding4fun.oakraven.net/downloads/BDD](http://webcoding4fun.oakraven.net/downloads/BDD) Example with  
CSharp.zip[http://webcoding4fun.oakraven.net/downloads/BDD%20Example%20with%20CSharp.zip](http://webcoding4fun.oakraven.net/downloads/BDD%20Example%20with%20CSharp.zip)  
I hope this helps a little.

Mike

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 29, 2010, 11:18pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/16 "2010-11-29T23:18:41Z")

</div>

Sorry Sundae, I had a type-o on the Cucumber version.

try:

igem install cucumber -v=0.6.4

It’s 0.6.4, not 1.6.4. Again. Apologies.

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 30, 2010, 5:50pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/17 "2010-11-30T17:50:37Z")

</div>

No need to apologize at all Mike. In any case, I should apologize to you  
for taking so much of your time.

I have some good news to report…It’s finally working. I was able to  
run your script without any problem.

Thank you so much for all the help and patience. Cory, Shay…thank you  
too. It took us 3 days but we did it. Cheers!

---

<div class="post-metadata">

**Author:** ![oliseh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oliseh](https://www.ruby-forum.com/u/oliseh)\
**Post date:** [November 30, 2010, 7:49pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-story-loaderror/199645/18 "2010-11-30T19:49:52Z")

</div>

That’s great to hear Sundae. Glad to help. I learned a bit myself. 🙂
