Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 167947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:21:57+00:00 2026-05-11T12:21:57+00:00

Hi and good evening, hope someone can help. I am trying to get some

  • 0

Hi and good evening, hope someone can help.

I am trying to get some sort of scripting support going. I have the following code, which executes a ruby method and returns the result. However, it is returning a ‘method not found error’ from IronRuby itself.

var engine = IronRuby.Ruby.CreateEngine(); returnvalue = engine.Operations.InvokeMember(instance, method, arg).ToString(); 

I am running the following ruby code as a test:

class Plotlight def get_message(a) res = 'Hello- from Ruby ' << a res end  def swapcase(a) res = a.downcase res end end 

Now, when running the method get_message('something'), things work great. However, when running something that has a reference to the standard library (swapcase in this example), it will return the error

$exception {'undefined method `downcase' for fooBAR:ClrString'} System.Exception {System.MissingMethodException} 

Running the code through ir.exe works without any problems.

Do I need to make a reference to the library, and if I do, how do I do that?

Hope someone can help! Thank you very much.

Kind regards,
Marco

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:21:58+00:00Added an answer on May 11, 2026 at 12:21 pm

    Ruby strings have semantics that are incompatible with CLR strings. In particular, they’re mutable. Interop between Ruby strings and CLR strings is not yet complete, so for now you’ll need to explicitly cast the CLR System.String into a Ruby string object — either in your C# code or in your Ruby code.

    The simplest solution is to define swapcase like this:

    def swapcase(a)   String.new(a).downcase end 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good evening. Can You help me please with some batch file? I have an
Good evening, i hope you can help me with this problem, as I'm struggling
Good evening,someone asked me to help her with fixing some code for asp.net, she
Good evening guys. I'm currently trying to get started on development of a project
Good evening, In a test JSF 2.0 web app, I am trying to get
Good evening people, I would like some help to compare a big-O and a
Good evening, here is what I am trying to achieve, I currently have a
Good evening everyone! I am working on learning some java and I have made
Good Evening, I can't seem to get my code to only add one instance
Good evening everyone, I was hoping you could help with an Objective-C question I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.