# Help getting ruby-serialport to run in Windows XP

**URL:** <https://www.ruby-forum.com/t/help-getting-ruby-serialport-to-run-in-windows-xp/135861>\
**Category:** Ruby\
**Created:** [April 25, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/help-getting-ruby-serialport-to-run-in-windows-xp/135861 "2008-04-25T19:00:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ealdaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9dc877/32.png) [@ealdaz](https://www.ruby-forum.com/u/ealdaz)\
**Post date:** [April 25, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/help-getting-ruby-serialport-to-run-in-windows-xp/135861/1 "2008-04-25T19:00:50Z")

</div>

Dear All

I have not been able to make ruby-serialport in Windows XP.  
[http://ruby-serialport.rubyforge.org/](http://ruby-serialport.rubyforge.org/)  
I have looked hard in the web and forums and have not been able to find  
help, although i have found many people that have been equaly  
unsuccesful.

It would be really great to have ruby-serialport work in Windows, it  
already works well in linux and cygwin (at least for me)

I have succesfully compiled for windows following the excellent  
instructions in:  
[http://blogs.law.harvard.edu/hoanga/2006/12/14/getting-a-ruby-c-extension-to-compile-on-windows/](http://blogs.law.harvard.edu/hoanga/2006/12/14/getting-a-ruby-c-extension-to-compile-on-windows/)  
It essential to read Part II)  
[http://blogs.law.harvard.edu/hoanga/2006/12/19/getting-a-ruby-c-extension-to-compile-on-windows-part-2/](http://blogs.law.harvard.edu/hoanga/2006/12/19/getting-a-ruby-c-extension-to-compile-on-windows-part-2/)

However no matter what i do when running the miniterm.rb example the  
program fails with:  
(eval):3:in `create': No such file or directory (Errno::ENOENT) from (eval):3:in `new’  
from miniterm.rb:11

I have painfully tracked (I think) the problem down to this part of the  
serialport.c code:

rb\_eval\_string(  
“class SerialPort\n”

```
"private_class_method(:create)\n"

"def SerialPort::new(port, *params)\n"
  "sp = create(port)\n" <============ BREAKS HERE
  "begin\n"
    "sp.set_modem_params(*params)\n"
         (...)

```

It would be great if someone more skilled could give me a hand with  
this, I have reached the limits of my (also limited) knowledge.

Or even if someone could give me a compiled and working serialport.so  
for windows XP would probably be good enough.

Thank you all  
Eduardo

---

<div class="post-metadata">

**Author:** ![ealdaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9dc877/32.png) [@ealdaz](https://www.ruby-forum.com/u/ealdaz)\
**Post date:** [April 25, 2008, 7:21pm UTC](https://www.ruby-forum.com/t/help-getting-ruby-serialport-to-run-in-windows-xp/135861/2 "2008-04-25T19:21:15Z")

</div>

On Fri, 25 Apr 2008 12:00:51 -0500  
Eduardo Aldaz-carroll [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> from miniterm.rb:11
> 
> ```

I’ve found that on the odd occassion I have to use serialport on  
Win32, using the following:

Kernel::require ‘serialport’

vice plain require, avoids its unhappiness with rubygems.

Has no adverse affect on Linux.

-jonathan

---

<div class="post-metadata">

**Author:** ![ealdaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9dc877/32.png) [@ealdaz](https://www.ruby-forum.com/u/ealdaz)\
**Post date:** [April 28, 2008, 9:40am UTC](https://www.ruby-forum.com/t/help-getting-ruby-serialport-to-run-in-windows-xp/135861/3 "2008-04-28T09:40:53Z")

</div>

Hi Jonathan,  
Thanks for the tip  
Kernel::require ‘serialport’  
does indeed help, very nice! I was calling the program with  
ruby -rselrialport miniterm.rb , which is not as clean.

Unfortunately this does not address the original problem i still get the  
same error message:

C:\>ruby miniterm.rb COM9 9600 8 1  
(eval):3:in `create': No such file or directory (Errno::ENOENT) from (eval):3:in`new’  
from miniterm.rb:11

Do you not get this error? Have you modified the source code? Do you  
think you could send me your .so ? any pointers on how to get this to  
work would be greatly appreciated!  
I use both linux and windows and would love to be able to use the same  
serialport extension for both.

Thanks again  
Eduardo
