Experimental RubyCLR gem
I finally got some time to hack together an experimental gem for RubyCLR distribution.
To install, just download the file and run gem install rubyclr-0.5.0.gem. Afterwards, run gem check -t rubyclr to verify that the unit tests pass on your computer.
There is still the unfortunate ActiveRecord dependency in the unit tests. So you must have the ActiveRecord gem installed if you want to pass the gem check. This will be fixed in the future.


02. Oct, 2006 







This is what I get from gem check -t rubyclr:
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load — rubyclr(LoadError)
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from ./tests/tests_basic.rb:4
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `unit_test’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `each’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `unit_test’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:559:in `execute’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/command.rb:69:in `invoke’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:117:in `process_args’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:88:in `run’
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:29:in `run’
from d:/ruby/bin/gem.bat:24
Are there some other steps as well? This is my first try to install RubyCLR.
Alexey, did you do the gem install step first? I’m assuming that you are running the Ruby 1 click installer? If so, what’s in your d:\ruby\lib\ruby\gems\1.8\gems\rubyclr-0.5.0\lib directory? Do you see rubyclr.rb there?
I did gem install, but
d:\ruby\lib\ruby\gems\1.8\gems\rubyclr-0.5.0\
only has tests and Samples subdirectories, nothing else.
Having the exact same issues as Alexey.
Just updated the file. The missing lib dir should be there now.
Much better! Thanks, John!
ERROR: 205 tests, 447 assertions, 2 failures, 2 errors
HI, John!
9:22:23 >gem install “C:\Documents and Settings\gaevsky\Desktop\rubyclr-0.5.0.gem”
Successfully installed rubyclr, version 0.5.0
C:\
9:22:35 >gem check -t rubyclr
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load — text/format (MissingSourceFile)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require’
from c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.0/lib/rubyclr.rb:2
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in `gem_original_require’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in `require’
from ./tests/tests_basic.rb:4
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `unit_test’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `each’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `unit_test’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:559:in `execute’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/command.rb:69:in `invoke’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:117:in `process_args’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:88:in `run’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:29:in `run’
from c:/ruby/bin/gem.bat:24
HI, John!
9:22:23 >gem install “C:\Documents and Settings\gaevsky\Desktop\rubyclr-0.5.0.gem”
Successfully installed rubyclr, version 0.5.0
C:\
9:22:35 >gem check -t rubyclr
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load — text/format (MissingSourceFile)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require’
from c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.0/lib/rubyclr.rb:2
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in `gem_original_require’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in `require’
from ./tests/tests_basic.rb:4
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `unit_test’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `each’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb:134:in `unit_test’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:559:in `execute’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/command.rb:69:in `invoke’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:117:in `process_args’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:88:in `run’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:29:in `run’
from c:/ruby/bin/gem.bat:24
9:27:57 >gem install text-format
…
C:\
9:29:40 >gem check -t rubyclr
ERROR: 205 tests, 447 assertions, 2 failures, 2 errors
Here is result of running RssReader.rb(((
http://rafb.net/paste/results/KOhNAq99.html
Brent, I think you have an older version of the gem – download it again. The older version was missing the entire lib directory (due to curious interpretation of / vs. \ in Ruby.
John,
Worked like a charm! I got similar outputas Andrej and others above, but was not able to determine where the two errors where.
Not able to get it:
C:\ruby>gem install rubyclr-0.5.0.gem
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find rubyclr-0.5.0.gem (> 0) in the repository
(“…you were not put on this earth to ‘get it’, mr. burton…)
Nevermind…working fine now.
Hi,
first, I would like to say *thank you* for RubyCLR. It’s a very nice project.
Now, to what I think is bug/feature that needs fixing. hehe. Here’s the code:
require ‘wpf’
w = Window.new
sp = StackPanel.new
sp.orientation = Orientation::Horizontal
cb = CheckBox.new
sp.children.add cb
cb.content = ‘Test?’
cb.isEnabled = true #runs
#cb.IsChecked = true # doesn’t run
#p cb.IsChecked # doesn’t run
w.content = sp
w.show
Application.new.run
Maybe the problem is that the “ischecked” property has three states? Null/True/False? But when one of the commented out lines are uncommented, I get some error here. I’m using your latest gem version.
Thanks again. Great, wonderful job.
Hi Joao,
Yes – there’s a problem with nullable types right now. I need to up the priority on that item – a workaround that I use is to create an explicit wrapper method using the inline C# feature of RubyCLR to at least make it so that you can make forward progress.
Hope that helps!
Here’s the code again:
Hi,
I’ve got the same problem as Brent:
> ERROR: While executing gem … (NoMethodError) undefined method `reference_file’ for #
The gems\rubyclr-0.5.0 contains lib directory.
> ruby 1.8.4 (2006-04-14) [i386-mswin32]
C:\installers>gem check -t rubyclr
ERROR: While executing gem … (NoMethodError)
undefined method `reference_file’ for #
Downloaded the gem at 6:50 p.m. on October 3rd.
C:\ruby\lib\ruby\gems\1.8\gems\rubyclr-0.5.0\tests
>ruby tests_basic.rb
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__’: No
such file to load — text/format (MissingSourceFile)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `re
quire’
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_suppo
rt/dependencies.rb:147:in `require’
from c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.0/lib/rubyclr.rb:2
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:24:in `re
quire__’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:24:in `re
quire’
from tests_basic.rb:4
C:\Documents and Settings\shanselm
>”c:\ruby\bin\ruby.exe” “c:\ruby\bin\gem” check -t rubyclr
ERROR: While executing gem … (NoMethodError)
undefined method `reference_file’ for #
Regarding the text/format gem, you’ll need to gem install text-format first. I still need to remove that dependency (or figure out a good layering mechanism).
Cool, it worked, John! With all the “inline” power, what can’t be done, then?
Please don’t answer. j/k.
I tried to use VB.NET for its dynamic support, so I can later reuse this a code like this one for several different controls. Here’s the code:
Totally amazing! Thanks.
I’m cool with dependencies, it’s just that I’d rather be prompted during the install of your gem for those.
I’m still learning the whole gem and dependency thing. It will be fixed on the next release of the gem.
Here is a complete RubyCLR installation guide – > http://gaech.blogspot.com/2006/10/rubyclr-complete-installation-guide.html
As an update to my previous complaint. I tried installing rubyclr on another machine and it works fine (are 2 unit tests errors ok?).
The machine differs in ruby version (the successful one is using ruby 1.8.4 (2005-12-24) [i386-mswin32], while the previous one was using ruby 1.8.4 (2006-04-14) [i386-mswin32]. Could it be a source of problem?
Andrej, thanks for creating the installation guide!
Andrzej, I have to start creating a VMWare machine matrix to track issues on different Ruby versions – I’m still building on 1.8.2 to stay conservative for the time being. But clearly, I need to start testing on more recent builds of Ruby.
Awesome John and thanks for the install guide Andrzej.
OK, installed text-format and text-hyphen. Now, when I run
gem check -t rubyclr
i get:
./tests/tests_basic.rb:174: [BUG] Segmentation fault
ruby 1.8.4 (2006-04-14) [i386-mswin32]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
Might this, perchance, have something to do with not having the .Net 3 CTP framework(s) installed?
Will, this looks like the problem that Andrezj mentioned earlier in the comments. It’s that specific version of Ruby (1.8.4 from 2006-04-14). If you revert to the Christmas build it apparently works. I’m going to need to install that version of Ruby somewhere so that I can debug what’s causing this segfault.
Works perfectly here!
Pardon my ignorance but I am trying the run posted by Joao and run into the following problem (ruby 1.8.5):
irb(main):001:0> require ‘wpf’
NameError: undefined local variable or method `get_types_in_loaded_assemblies’ for RubyClr:Module
from C:/Development/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.0/lib/dynamicmethod.rb:183:in `method_missing’
from C:/Development/ruby/lib/rubyclr/Src/Ruby/core.rb:446:in `init’
from C:/Development/ruby/lib/rubyclr/Src/Ruby/core.rb:476
from C:/Development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from C:/Development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from C:/Development/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `
equire’
from C:/Development/ruby/lib/rubyclr/Src/Ruby/rubyclr.rb:10
from C:/Development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from C:/Development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from C:/Development/ruby/lib/rubyclr/Src/Ruby/wpf.rb:1
from C:/Development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from C:/Development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from (irb):1
irb(main):002:0>
What do i need to do here?
Ignorant indeed: I guess I would have to install .net 3.0 first — Duh!!
i m also facing the same issue i get the following error when i m using ruby with some .net framework
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-mswin32/Src/Ruby/dynamicmethod.rb:183:
in `method_missing’
did i missed anything in installation ?