Spec Help!

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:inload’
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:ineach’
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:inrun_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:inload’
from c:/ruby/bin/spec:19

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

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?

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

A complete problem statement?

On Wed, Jun 16, 2010 at 3:02 PM, Mohammad A. [email protected]
wrote:

http://rubyforge.org/mailman/listinfo/ironruby-core


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

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. [email protected]
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/.


Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


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

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

./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