Using Iron Ruby classes in native Ruby class - ruby

I'm wondering if an Iron Ruby class/object can be used in a native ruby interpreter(irb) driven class(using a gem sort of a thing) ? The main problem is that I have a ruby class that is using some gems(Ex: nokogiri) which are not compatible with Iron Ruby and Iron Ruby class is using .Net libraries. So in short, I want to know if there are any ways to communicate with iron ruby classes in native ruby. If there are any alternatives to solve this, please do mention them.

No other way than having two different processes for each ruby interpreter running with some kind of communication. You could use distributed ruby for that. Anyway, the best thing to do is to not use .Net libraries and replace them with something else from ruby world.

Related

What is the difference between Ruby and Ruby on Rails (web framework)? [duplicate]

I have been studying Ruby for the past few days and I have noticed there is Ruby on Rails.
What is the difference between the two? Do they work together? Is the syntax the same?
Ruby is a programming language. Ruby on Rails ("RoR") is a web-application framework that is implemented in Ruby.
So they not only "work together" but RoR depends on Ruby.
Ruby is a general purpose language. Ruby on Rails is a Ruby framework for implementing web applications.
Ruby is an interpreted scripting language for quick and easy object-oriented programming.
Ruby is a programming Language
Ruby on Rails is web-development framework.
You can read more in "Small Discussion about Ruby on Rails".
Just like PHP has Codeigniter , CakePHP and Laravel, similarly, Ruby has Ruby on Rails ("RoR").
Ruby is a scripting language and Rails is a framework which is built using Ruby.
Ruby and Rails are tightly coupled and "Rails is magic emerged out of Ruby". Whatever you write in a Rails application is just Ruby code.
When you run a Rails application, you are just interpreting the Ruby code using Ruby's interpreter.
Ruby on Rails is a library written in the Ruby language. Its popularity prompted many people to take up writing in Ruby to make use of it, which led many people to treat them as inseparable. :)

Can I use Ruby with Shoes for GUI for a multiple choice test app?

I'm trying to make a simple multiple choice question app. Is this possible on ruby?
I've tried using shoes but I don't know how to create multiple classes and a GUI that uses them.
I'm also trying to connect all of this to a database.
I'm having trouble in understanding how to connect all of this together.
According to the comments the main problem seems to be with using the mysql gem part.
Gem usage depends on the version of shoes you are using. For green_shoes you should be good with the standard gems, but it is unmaintained. Shoes 3.1 has problems with gems that have C extensions (such as mysql). Shoes 3.2 should work. With Shoes4 you can't install the normal Ruby gems with C extensions as it uses JRuby and C extension support in JRuby is disabled. You have to use different gems to connect to the database, functionality is the same. A starting point might be activerecord-jdbc.

Is possible to use QtConcurrent with Ruby (mingw-32)?

How can I use the QtConcurrent Qt module in Ruby?
I'm developing a small app that uses Qt (through the qtbindings binary gem) in Windows (Ruby 1.9.3 mingw-32) but I couldn't find a way to use threads (or use simple concurrent methods calls).
Any help and any example would be very helpful.
Thanks in advance.
I have a feeling that its no different than PyQt4, where QtConcurrent is not available because they can't easily wrap it. If its not being built with your Ruby bindings, its probably not available. You would need to stick to QThread and its siblings.

IPC with Ruby 1.8.5

I need to do IPC with Ruby 1.8.5. The catch is that it's the Ruby that ships with Google SketchUp, and is only a subset of the full Ruby API. So for instance, there's no Socket class, and no DRb.
What are some other way's of doing IPC with Ruby? Anything that uses the File class, like memory mapped files, or something like that? I'm completely new to IPC, so I apologize if I missed something obvious.
The latest version of SketchUp ships with Ruby 1.8.6. You can download (if you haven't already) the core Ruby API, and just require whatever files you need, to implement your script.
Testing non-SketchUp Ruby code, is much easier outside of SketchUp, with the command line, or an editor like SciTE. Then you can add your SketchUp code for tests within the application.
Ruby Download
SciTE Download

If I have jRuby on Rails installed can I use only Ruby?

What I mean by this is if I install jRuby on Rails, can I use only the ruby language to build my application? I wanted to install my rails application with jRuby in case I wanted to use Java in the future, though I don't need it now. Or do I not understand? Is jRuby ruby that has access to java libraries?
yes, jruby is ruby (your ruby scripts need no modification to run under jruby). in addition, it has full access to java libraries - check out the wiki for how easy it is to integrate a java class or library into your ruby code.
The others have answered your direct question. I just want to say that I've been using jruby full time at work for the past 6 months and it's great. Deploying a rails app with the glassfish gem is very easy and jruby performs better than MRI ruby 1.8.x.
I've seen no real downside after 6 months other than the fact that we can't use gems that have pieces written in C. However, we've taken a C library and created a gem using FFI and it wasn't too much trouble.
It's also really easy to speed up your app by writing a few key pieces in java (which is easier t work with than C).

Resources