Require 'spec' not working


#1

hi,
i’ve downloaded the latest ironruby 0.3 and built it locally.
its in my path

GEM_PATH C:\ruby\lib\ruby\gems\1.8\gems
PATH c:\ruby\bin;C:\ironruby\Merlin\Main\bin\Debug

File: product_spec.rb

require ‘rubygems’
require ‘spec’
require File.dirname(FILE) +
‘/IronRubyInterop/IronRubyInterop/bin/Debug/IronRubyInterop.dll’

describe IronRubyInterop::Product do

it “should have a name” do end
it “should have a category”
it “should have product lines”

end

running ir product_spec.rb

i get:

D:\IronRuby\RSpec>ir product_spec.rb
:0:in require': no such file to load -- spec (LoadError) from custom_require.rb:26:inrequire’
from product_spec.rb:0

Is there anything I’m missing???

Regards.


#2

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#3

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right
directories. I am on the git layout so my paths won’t make sense for
you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit


#4

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.

2009/3/26 Shri B. removed_email_address@domain.invalid


#5

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,
Shri

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 12:59 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:
Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#6

Could you change your igem.bat to the following, and set
IRONRUBY_GEM_PATH, and then see if it works as you like? This would
allow having different GEM_PATHs for MRI and for IronRuby.

@echo off
setlocal
if defined IRONRUBY_GEM_PATH (
set GEM_PATH=%IRONRUBY_GEM_PATH%
)
@“ir.exe” “%~dpn0” %*

Thanks,
Shri

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 1:42 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.

2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#7

Should we have a IGEM_PATH that defaults to GEM_PATH to allow for this
usage?

JD

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 1:42 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.

2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#8

Doesn’t gem do that already? It’ll look in a directory based on the
implementation name, which is why you see gems/ruby and gems/ironruby
…?

~Jimmy
Sent from my phone

On Mar 26, 2009, at 1:43 PM, “Ivan Porto C.”
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.

2009/3/26 Shri B.
<mailto:removed_email_address@domain.invalidremoved_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35
http://docs.rubygems.org/read/chapter/10#page35. Does anyone know of a
verbose option?

Thanks,

Shri

From: mailto:removed_email_address@domain.invalid
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:mailto:removed_email_address@domain.invalidremoved_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: mailto:removed_email_address@domain.invalid
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<mailto:removed_email_address@domain.invalidremoved_email_address@domain.invalidmailto:removed_email_address@domain.invalid>
wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#9

Gemrc gets used by both gem and igem, so that might still not work.
Jimmy’s solution might be the best so far (leaving it with the separate
directories).

JD

From: Shri B.
Sent: Thursday, March 26, 2009 2:52 PM
To: Shri B.; removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

The solution seems to be using a gemrc file.
http://blogs.sun.com/mandy/entry/rubygems_etc_gemrc describes the file,
but says that it is only used by the gem command, and not honored by a
“require ‘somgem’”. However,
http://rubyforge.org/pipermail/rubygems-developers/2008-September/004056.html
says that this was a bug and has been fixed.

From: Shri B.
Sent: Thursday, March 26, 2009 2:06 PM
To: Shri B.; ‘removed_email_address@domain.invalid’
Subject: RE: [Ironruby-core] require ‘spec’ not working

I realized that this would only work for the igem.bat command and not
while running a program which does “require rubygems”. We can figure out
some way to get ir.exe to pick this up as well, like adding code to
%HOME%.irconfig.rb. Tomas, do we still support .irconfig.rb? I couldn’t
find anything while grepping the sources.

Thanks,
Shri

From: Shri B.
Sent: Thursday, March 26, 2009 1:48 PM
To: removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

Could you change your igem.bat to the following, and set
IRONRUBY_GEM_PATH, and then see if it works as you like? This would
allow having different GEM_PATHs for MRI and for IronRuby.

@echo off
setlocal
if defined IRONRUBY_GEM_PATH (
set GEM_PATH=%IRONRUBY_GEM_PATH%
)
@“ir.exe” “%~dpn0” %*

Thanks,
Shri

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 1:42 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.
2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#10

Spec.rb is the main RSpec require.

JD


#11

Ah yes, gemrc is declarative, not Ruby code which could do things
differently depending on the ruby implementation. I got distracted about
it not working with “require ‘some_gem’”, and forgot about this fact.

Leaving it with separate directories does not allow IronRuby to use gems
installed by Ruby, which would be nice. Ivan’s scenario is where he
wants IronRuby to use a gem installed by MRI, but not vice versa.

It does beg the question why you would want to do such a thing? Ivan,
can you explain your motivation? Today people can either keep their gems
completely separate (the default behavior if GEM_PATH is not set), or
can chose to share everything in both directions. This should work
reasonably well most of the time. Would be nice to just leave it at that
since it’s a simple solution. For scenarios where you want more control,
the user can do something specific to the solution. For example,
http://www.mail-archive.com/removed_email_address@domain.invalid/msg02295.html
describes how you could copy lib\rubygems\default.rb.

Thanks,
Shri

From: Jim D.
Sent: Thursday, March 26, 2009 2:56 PM
To: Shri B.; removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

Gemrc gets used by both gem and igem, so that might still not work.
Jimmy’s solution might be the best so far (leaving it with the separate
directories).

JD

From: Shri B.
Sent: Thursday, March 26, 2009 2:52 PM
To: Shri B.; removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

The solution seems to be using a gemrc file.
http://blogs.sun.com/mandy/entry/rubygems_etc_gemrc describes the file,
but says that it is only used by the gem command, and not honored by a
“require ‘somgem’”. However,
http://rubyforge.org/pipermail/rubygems-developers/2008-September/004056.html
says that this was a bug and has been fixed.

From: Shri B.
Sent: Thursday, March 26, 2009 2:06 PM
To: Shri B.; ‘removed_email_address@domain.invalid’
Subject: RE: [Ironruby-core] require ‘spec’ not working

I realized that this would only work for the igem.bat command and not
while running a program which does “require rubygems”. We can figure out
some way to get ir.exe to pick this up as well, like adding code to
%HOME%.irconfig.rb. Tomas, do we still support .irconfig.rb? I couldn’t
find anything while grepping the sources.

Thanks,
Shri

From: Shri B.
Sent: Thursday, March 26, 2009 1:48 PM
To: removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

Could you change your igem.bat to the following, and set
IRONRUBY_GEM_PATH, and then see if it works as you like? This would
allow having different GEM_PATHs for MRI and for IronRuby.

@echo off
setlocal
if defined IRONRUBY_GEM_PATH (
set GEM_PATH=%IRONRUBY_GEM_PATH%
)
@“ir.exe” “%~dpn0” %*

Thanks,
Shri

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 1:42 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.
2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#12

I realized that this would only work for the igem.bat command and not
while running a program which does “require rubygems”. We can figure out
some way to get ir.exe to pick this up as well, like adding code to
%HOME%.irconfig.rb. Tomas, do we still support .irconfig.rb? I couldn’t
find anything while grepping the sources.

Thanks,
Shri

From: Shri B.
Sent: Thursday, March 26, 2009 1:48 PM
To: removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

Could you change your igem.bat to the following, and set
IRONRUBY_GEM_PATH, and then see if it works as you like? This would
allow having different GEM_PATHs for MRI and for IronRuby.

@echo off
setlocal
if defined IRONRUBY_GEM_PATH (
set GEM_PATH=%IRONRUBY_GEM_PATH%
)
@“ir.exe” “%~dpn0” %*

Thanks,
Shri

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 1:42 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.
2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#13

That won’t work, because you don’t always use igem to use Rubygems.

JD

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Shri B.
Sent: Thursday, March 26, 2009 1:48 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Could you change your igem.bat to the following, and set
IRONRUBY_GEM_PATH, and then see if it works as you like? This would
allow having different GEM_PATHs for MRI and for IronRuby.

@echo off
setlocal
if defined IRONRUBY_GEM_PATH (
set GEM_PATH=%IRONRUBY_GEM_PATH%
)
@“ir.exe” “%~dpn0” %*

Thanks,
Shri

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 1:42 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.
2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#14

For MRI I also don’t have to set a GEM_PATH variable. I would prefer to
keep
it that way for ironruby too.

Isn’t the default lib and it’s children added to the ir.exe.config ?
I just saw that the ironruby gems install in an ironruby folder so they
are
already separated.

2009/3/26 Jim D. removed_email_address@domain.invalid


#15

The solution seems to be using a gemrc file.
http://blogs.sun.com/mandy/entry/rubygems_etc_gemrc describes the file,
but says that it is only used by the gem command, and not honored by a
“require ‘somgem’”. However,
http://rubyforge.org/pipermail/rubygems-developers/2008-September/004056.html
says that this was a bug and has been fixed.

From: Shri B.
Sent: Thursday, March 26, 2009 2:06 PM
To: Shri B.; ‘removed_email_address@domain.invalid’
Subject: RE: [Ironruby-core] require ‘spec’ not working

I realized that this would only work for the igem.bat command and not
while running a program which does “require rubygems”. We can figure out
some way to get ir.exe to pick this up as well, like adding code to
%HOME%.irconfig.rb. Tomas, do we still support .irconfig.rb? I couldn’t
find anything while grepping the sources.

Thanks,
Shri

From: Shri B.
Sent: Thursday, March 26, 2009 1:48 PM
To: removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

Could you change your igem.bat to the following, and set
IRONRUBY_GEM_PATH, and then see if it works as you like? This would
allow having different GEM_PATHs for MRI and for IronRuby.

@echo off
setlocal
if defined IRONRUBY_GEM_PATH (
set GEM_PATH=%IRONRUBY_GEM_PATH%
)
@“ir.exe” “%~dpn0” %*

Thanks,
Shri

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 1:42 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.
2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri


#16

Actually I don’t want to use gems installed by ruby… that doesn’t make
sense to me. I will install duplicates if I need it. I actually want
the
default behavior :slight_smile:

I was replying to the question of Michael D. on how he couldn’t get
the
rspec gem to run :slight_smile: And because he was setting GEM_PATH I tried to
explain
that he doesn’t need to do that anymore. And then showed how it just
works
for me without setting a gem_path or anything.

It seems that there is confusion on how people need to use gems with
ironruby, because of earlier blog posts when you needed to use the gems
from
ruby. There is also a wiki on github for a gem that explains it to do it
that way.

Also if I wanted to use a non-standard layout for my dirs it would make
sense to me to have to set GEM_PATH or IGEM_PATH.

2009/3/26 Shri B. removed_email_address@domain.invalid


#17

thanks guys for all the help,

i removed the GEM_PATH env variable,
reinstalled rspec using igem install rspec.

and it worked. :slight_smile:


#18

I changed
http://www.ironruby.net/index.php?title=Documentation/How_do_I_install_additional_gems%3F
as such:

  • Do not share gems with MRI - By default, RubyGems looks in
    different locations for each Ruby implementation. For IronRuby, it would
    look in c:\ironruby\lib\ironruby\gems\1.8 assuming ir.exe exists in
    c:\ironruby\bin. In this case, you will need to install all gems you
    want to use with IronRuby using igem.bat (c:\ironruby\bin\igem.bat).
  • Share gems with MRI - Set the GEM_PATH environment variable in your
    user profile to point to your \lib\ruby\gems\1.8 directory, e.g.
    c:\ruby\lib\ruby\gems\1.8. This allows sharing of gems with MRI.
    IronRuby also includes igem.bat which runs gems with IronRuby. This can
    be used to install IronRuby-specific gems.
  • Note that the GEM_HOME environment variables controls where new
    gems will be installed by running igem.bat. Unless you set this to match
    GEM_PATH, note that gems installed by “igem.bat” may not be usable from
    IronRuby [need to check if this is true or not]. And if you set GEM_PATH
    to include the location of IronRuby gems, MRI will be able to find them
    as well.
    Either option is valid.

Thanks,
Shri

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Thursday, March 26, 2009 3:23 PM
To: removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

Actually I don’t want to use gems installed by ruby… that doesn’t make
sense to me. I will install duplicates if I need it. I actually want
the default behavior :slight_smile:

I was replying to the question of Michael D. on how he couldn’t get
the rspec gem to run :slight_smile: And because he was setting GEM_PATH I tried to
explain that he doesn’t need to do that anymore. And then showed how it
just works for me without setting a gem_path or anything.

It seems that there is confusion on how people need to use gems with
ironruby, because of earlier blog posts when you needed to use the gems
from ruby. There is also a wiki on github for a gem that explains it to
do it that way.

Also if I wanted to use a non-standard layout for my dirs it would make
sense to me to have to set GEM_PATH or IGEM_PATH.

2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

Ah yes, gemrc is declarative, not Ruby code which could do things
differently depending on the ruby implementation. I got distracted about
it not working with “require ‘some_gem’”, and forgot about this fact.

Leaving it with separate directories does not allow IronRuby to use gems
installed by Ruby, which would be nice. Ivan’s scenario is where he
wants IronRuby to use a gem installed by MRI, but not vice versa.

It does beg the question why you would want to do such a thing? Ivan,
can you explain your motivation? Today people can either keep their gems
completely separate (the default behavior if GEM_PATH is not set), or
can chose to share everything in both directions. This should work
reasonably well most of the time. Would be nice to just leave it at that
since it’s a simple solution. For scenarios where you want more control,
the user can do something specific to the solution. For example,
http://www.mail-archive.com/removed_email_address@domain.invalid/msg02295.html
describes how you could copy lib\rubygems\default.rb.

Thanks,

Shri

From: Jim D.
Sent: Thursday, March 26, 2009 2:56 PM

To: Shri B.;
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

Gemrc gets used by both gem and igem, so that might still not work.
Jimmy’s solution might be the best so far (leaving it with the separate
directories).

JD

From: Shri B.
Sent: Thursday, March 26, 2009 2:52 PM
To: Shri B.;
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

The solution seems to be using a gemrc file.
http://blogs.sun.com/mandy/entry/rubygems_etc_gemrc describes the file,
but says that it is only used by the gem command, and not honored by a
“require ‘somgem’”. However,
http://rubyforge.org/pipermail/rubygems-developers/2008-September/004056.html
says that this was a bug and has been fixed.

From: Shri B.
Sent: Thursday, March 26, 2009 2:06 PM
To: Shri B.;
‘removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

I realized that this would only work for the igem.bat command and not
while running a program which does “require rubygems”. We can figure out
some way to get ir.exe to pick this up as well, like adding code to
%HOME%.irconfig.rb. Tomas, do we still support .irconfig.rb? I couldn’t
find anything while grepping the sources.

Thanks,

Shri

From: Shri B.
Sent: Thursday, March 26, 2009 1:48 PM
To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: RE: [Ironruby-core] require ‘spec’ not working

Could you change your igem.bat to the following, and set
IRONRUBY_GEM_PATH, and then see if it works as you like? This would
allow having different GEM_PATHs for MRI and for IronRuby.

@echo off

setlocal

if defined IRONRUBY_GEM_PATH (

set GEM_PATH=%IRONRUBY_GEM_PATH%

)

@“ir.exe” “%~dpn0” %*

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 1:42 PM
To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
Subject: Re: [Ironruby-core] require ‘spec’ not working

igem env gives you all the paths rubygems look in

I actually want a separate list of gems for IronRuby and my Ruby install
hence I added a different subdir as my gem path for ironruby.

2009/3/26 Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid>

You should not be editing ir.exe.config as you would end up adding new
paths for every new library you want to use, which would not be a good
thing. Using GEM_PATH is the right solution as you would be using the
power of rubygems to find the gems.

You should run “igem query --local --name-matches spec” to make sure
that RubyGems will indeed be able to find the gem. I wish there was a
verbose mode where gem could tell you the paths it looked in, but I
don’t see anything at http://docs.rubygems.org/read/chapter/10#page35.
Does anyone know of a verbose option?

Thanks,

Shri

From:
removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid]
On Behalf Of Ivan Porto C.
Sent: Thursday, March 26, 2009 12:59 PM

To: removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid

Subject: Re: [Ironruby-core] require ‘spec’ not working

Hi

Did you edit your ir.exe.config to point to the right gems dir?

I don’t think you still need to set the GEM_PATH do you?

It works for me and all I do is edit the ir.exe.config to point to the
right directories. I am on the git layout so my paths won’t make sense
for you.

When I did that I could do

igem list

*** LOCAL GEMS ***

igem install rspec


Thank you for installing rspec-1.2.2

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

Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2…
Installing RDoc documentation for rspec-1.2.2…
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

ir
IronRuby 0.3.0.0 on .NET 2.0.50727.3074

require ‘rubygems’
=> true

require ‘spec’
=> true

true.should == true
=> true

exit

On Thu, Mar 26, 2009 at 8:17 PM, Shri B.
<removed_email_address@domain.invalidmailto:removed_email_address@domain.invalid> wrote:

Does it work with MRI (not the IronRubyInteorp part ofcourse)? Where do
you expect spec.rb to be loaded from? I don’t have spec.rb on my
machine.

Thanks,
Shri