# Spec Help!

**URL:** <https://www.ruby-forum.com/t/spec-help/190140>\
**Category:** IronRuby\
**Created:** [June 16, 2010, 11:51pm UTC](https://www.ruby-forum.com/t/spec-help/190140 "2010-06-16T23:51:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [June 16, 2010, 11:51pm UTC](https://www.ruby-forum.com/t/spec-help/190140/1 "2010-06-16T23:51:26Z")

</div>

Hi,

Do I have to install IronRuby in C:\IronRuby?

I have it installed somewhere else inside the C:\DevTools\IronRuby and  
having trouble running spec.

When I do this:

igem install rspec

I get the following:

WARNING: Installing to ~/.gem since C:/Program Files/IronRuby  
1.0v4/lib/ironrub  
y/gems/1.8 and  
C:/Program Files/IronRuby 1.0v4/bin aren’t both writable.  
WARNING: You don’t have C:/Users/azamsharp/.gem/ironruby/1.8/bin in  
your PATH,  
gem executables will not run.

* * *

Here is my code:

require ‘rubygems’  
require ‘spec’

require File.dirname( **FILE** ) + ‘/bin/Debug/BusinessObjects.dll’

include BusinessObjects

describe Account do

before do

@account = Account.new

end

end

When I run the above code I get the following:

C:\Projects\IronRubyDemo\IronRubyDemoSolution\BusinessObjects\>spec  
testaccountsp  
ec.rb --format nested  
./bin/Debug/BusinessObjects.dll: 127: The specified procedure could not  
be found  
. - Init\_BusinessObjects (LoadError)  
./bin/Debug/BusinessObjects.dll from  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/cus  
tom\_require.rb:31:in `require' from ./testaccountspec.rb:5 from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_ group_runner.rb:15:in`load’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example\_  
group\_runner.rb:15:in `load_files' from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_ group_runner.rb:14:in`each’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example\_  
group\_runner.rb:14:in `load_files' from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/options. rb:133:in`run\_examples’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/command\_  
line.rb:9:in `run' from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/bin/spec:5 from c:/ruby/bin/spec:19:in`load’  
from c:/ruby/bin/spec:19

The error is weird since the “/bin/Debug/” directory does contain the  
BusinessObjects.dll.

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [June 17, 2010, 12:02am UTC](https://www.ruby-forum.com/t/spec-help/190140/2 "2010-06-17T00:02:10Z")

</div>

I uninstalled IronRuby and then reinstall it in C:\IronRuby. The first  
warning now went away but the error is still thrown when running spec  
filename.rb.

What am I missing?

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/spec-help/190140/3 "2010-06-17T16:22:42Z")

</div>

Sounds like you have two disconnected things going on …

> Do I have to install IronRuby in C:\IronRuby?

No, in fact the installer puts it in C:\Program Files\IronRuby …

> 1.0v4/lib/ironrub  
> y/gems/1.8 and  
> C:/Program Files/IronRuby 1.0v4/bin aren’t both writable.  
> WARNING: You don’t have C:/Users/azamsharp/.gem/ironruby/1.8/bin in  
> your PATH,  
> gem executables will not run.
> 
> * * *

Looks like you’re running ir.exe from C:/Program Files/IronRuby  
1.0v4/bin. Check your OS PATH environment variable and move whichever  
path to the desired ir.exe first. By the way, the first warning is  
because you’re not running cmd.exe as Administrator (if IronRuby is  
installed in a location you’re user doesn’t have write access to). The  
second warning is a result of the first, and what it says exactly; the  
gem bin path is on your OS PATH, so add it.

Now on to your second issue, I guess …

> describe Account do
> 
> ```
> from ./testaccountspec.rb:5
> from
> 
> ```

[snip]

> The error is weird since the “/bin/Debug/” directory does contain the  
> BusinessObjects.dll.

Can you please provide a smaller repro; Preferably 1-2 lines of Ruby  
code, and the source to an example DLL you’re trying to load (please  
don’t send the source to BusinessObjects.dll … it won’t be helpful).  
It’s almost 100% certain we’ll help get this fixed, but only if we can  
reproduce it.

~Jimmy

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/spec-help/190140/4 "2010-06-17T16:22:46Z")

</div>

A complete problem statement?

On Wed, Jun 16, 2010 at 3:02 PM, Mohammad A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> [http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

–  
“The explanation requiring the fewest assumptions is most likely to be  
correct.”

- Occamâ€™s Razor  
[Occam's razor - Wikipedia](http://en.wikipedia.org/wiki/Occam's_Razor)

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/spec-help/190140/5 "2010-06-17T16:22:44Z")

</div>

Interesting. I didn’t have rspec installed on my work machine so I ran  
through this drill locally on XP:

G:\> set-ironruby  
G:\> d:  
D:\> igem list

\*\*\* LOCAL GEMS \*\*\*

actionmailer (2.3.8, 2.3.5)  
actionpack (2.3.8, 2.3.5)  
activerecord (2.3.8, 2.3.5)  
activerecord-adonet-sqlserver (0.3.4)  
activerecord-sqlserver-adapter (2.3.5, 2.3.1)  
activeresource (2.3.8, 2.3.5)  
activesupport (2.3.8, 2.3.7, 2.3.5)  
bind (0.2.8)  
bson (1.0.1, 1.0, 0.20.1)  
commander (4.0.3)  
dbd-adonet (0.3.2)  
dbd-adonet-sqlserver (0.3.2)  
dbi (0.4.5, 0.4.3)  
deprecated (3.0.0, 2.0.1)  
highline (1.5.2)  
jnunemaker-validatable (1.8.4)  
json\_pure (1.4.3)  
jspec (4.3.1)  
mongo (1.0.1, 1.0, 0.20.1)  
mongo\_mapper (0.7.4)  
nifty-generators (0.4.0)  
panztel-actionwebservice (2.3.5)  
rack (1.1.0, 1.0.1)  
rails (2.3.8, 2.3.5)  
rake (0.8.7)  
sinatra (1.0)  
sqlite3-ironruby (0.1.1)  
D:\> igem install rspec

* * *

Thank you for installing rspec-1.3.0

Please be sure to read History.rdoc and Upgrade.rdoc  
for useful information about this release.

* * *

Successfully installed rspec-1.3.0  
1 gem installed  
Installing ri documentation for rspec-1.3.0…  
Installing RDoc documentation for rspec-1.3.0…  
Could not find main page README.rdoc  
Could not find main page README.rdoc  
Could not find main page README.rdoc  
Could not find main page README.rdoc  
D:\>

So as you can see, I didn’t get the same warning you did when  
installing.  
You mentioned that you had reinstalled ironruby to C:\ironruby, do you  
still  
have something in the C:\Prog Files\Iron Ruby\ folder? What is in your  
path?  
Check out $env:path in powershell, do you have both paths there?

Also, what OS are you running on? In some OSes you need to be running  
with  
elevated privileges to write to the prog files directory. This is most  
likely what is nuking your igem install.

On Wed, Jun 16, 2010 at 2:51 PM, Mohammad A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> describe Account do
> 
> ```
> from ./testaccountspec.rb:5
> 
> ```
> 
> c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example\_
> 
> ## The error is weird since the “/bin/Debug/” directory does contain the BusinessObjects.dll.
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Ironruby-core mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

–  
“The explanation requiring the fewest assumptions is most likely to be  
correct.”

- Occamâ€™s Razor  
[Occam's razor - Wikipedia](http://en.wikipedia.org/wiki/Occam's_Razor)

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [June 17, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/spec-help/190140/6 "2010-06-17T16:27:02Z")

</div>

Hi Jim,

Your tip of using ir -S spec worked.

And also I find that spec is running much faster than the previous  
versions.

Thanks,  
Azam

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [June 17, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/spec-help/190140/7 "2010-06-17T16:26:59Z")

</div>

> ./bin/Debug/BusinessObjects.dll: 127: The specified procedure could  
> not be found  
> . - Init\_BusinessObjects (LoadError)  
> ./bin/Debug/BusinessObjects.dll from  
> c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/cus  
> tom\_require.rb:31:in `require’  
> from ./testaccountspec.rb:5  
> from  
> [snip]
> 
> The error is weird since the “/bin/Debug/” directory does contain the  
> BusinessObjects.dll.

The spec command is running MRI.

As can be seen by a) “The specified procedure could not be found -  
Init\_BusinessObjects” (MRI’s error when you try to load a non-ruby  
extension) b) the path to require "  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems"

You must use ir -S spec, as pointed out numerous times before by people  
on this list.

JD
