Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Can't get ruby serial port to work

Reply
Thread Tools

Can't get ruby serial port to work

 
 
Dd Dd
Guest
Posts: n/a
 
      10-25-2010
I recently installed Ruby Version 1.9.2 on my PC. I am trying to get
the serial port to work. On the command prompt, I typed "gem install
ruby-serialport", but it didn't go through. I attached the file of the
whole response from the command prompt. Here are the first few lines:

C:\Users\Deepak>gem install ruby-serialport
Building native extensions. This could take a while...
ERROR: Error installing ruby-serialport:
ERROR: Failed to build gem native extension.

What could be the problem? Do I need to add a file to the library?
Thanks.

Attachments:
http://www.ruby-forum.com/attachment...erial_Port.txt


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Jeremy Bopp
Guest
Posts: n/a
 
      10-25-2010
On 10/25/2010 5:30 PM, Dd Dd wrote:
> I recently installed Ruby Version 1.9.2 on my PC. I am trying to get
> the serial port to work. On the command prompt, I typed "gem install
> ruby-serialport", but it didn't go through. I attached the file of the
> whole response from the command prompt. Here are the first few lines:
>
> C:\Users\Deepak>gem install ruby-serialport
> Building native extensions. This could take a while...
> ERROR: Error installing ruby-serialport:
> ERROR: Failed to build gem native extension.
>
> What could be the problem? Do I need to add a file to the library?
> Thanks.


You probably need to at least install the appropriate development kit
for your Ruby installation. You can find what you need here:

http://rubyinstaller.org/downloads/

-Jeremy

 
Reply With Quote
 
 
 
 
Dd Dd
Guest
Posts: n/a
 
      10-25-2010
Where would I download the development kit to in the Ruby192 folder?
Should it go in the bin with the Ruby application? Thanks.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Jeremy Bopp
Guest
Posts: n/a
 
      10-25-2010
On 10/25/2010 5:54 PM, Dd Dd wrote:
> Where would I download the development kit to in the Ruby192 folder?
> Should it go in the bin with the Ruby application? Thanks.


I believe the instructions for installation, among other things, can be
found here:

http://github.com/oneclick/rubyinsta...evelopment-Kit

-Jeremy

 
Reply With Quote
 
Dd Dd
Guest
Posts: n/a
 
      10-26-2010
I installed the developer, but still can't get the serial port to work.
I still get the following:
ruby 1.9.2p0 (2010-08-1 [i386-mingw32]

C:\Users\Deepak>sudo gem install ruby-serialport
'sudo' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Deepak>gem install ruby-serialport
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing ruby-serialport:
ERROR: Failed to build gem native extension.

C:/Users/Deepak/Ruby192/bin/ruby.exe extconf.rb
checking for OS... mingw
checking for termios.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Users/Deepak/Ruby192/bin/ruby


Gem files will remain installed in
C:/Users/Deepak/Ruby192/lib/ruby/gems/1.9.1/g
ems/ruby-serialport-0.7.0 for inspection.
Results logged to
C:/Users/Deepak/Ruby192/lib/ruby/gems/1.9.1/gems/ruby-serialpo
rt-0.7.0/ext/gem_make.out

I don't know what to do.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Dd Dd
Guest
Posts: n/a
 
      10-26-2010
Anyway, does anyone have any idea what the problem might be? It says
that one problem might be a lack of libraries or headers. I think it
failed when it reached this point: checking for termios.h... no
*** extconf.rb failed ***

I know that the termios.h fileis associated with UNIX specifically for
serial port operations. It seems to be different in Windows, but Ruby
doesn't seem to detect the equivalent file.

Also, do I need to download C to get Ruby to work? Thanks.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Luis Lavena
Guest
Posts: n/a
 
      10-26-2010
On Oct 26, 1:56*am, Dd Dd <d...@njit.edu> wrote:
> I installed the developer, but still can't get the serial port to work.


Did you follow the Development Kit instructions?

> C:/Users/Deepak/Ruby192/bin/ruby.exe extconf.rb
> checking for OS... mingw
> checking for termios.h... no
> *** extconf.rb failed ***
> Could not create Makefile due to some reason, probably lack of
> necessary libraries and/or headers. *Check the mkmf.log file for more
> details. *You may need configuration options.
>
> Gem files will remain installed in
> C:/Users/Deepak/Ruby192/lib/ruby/gems/1.9.1/g
> ems/ruby-serialport-0.7.0 for inspection.
> Results logged to
> C:/Users/Deepak/Ruby192/lib/ruby/gems/1.9.1/gems/ruby-serialpo
> rt-0.7.0/ext/gem_make.out
>


What are the contents of mkmf.log available in above path?

--
Luis Lavena
 
Reply With Quote
 
Dd Dd
Guest
Posts: n/a
 
      10-26-2010
I don't think I got an mkmf.log file, but I followed the development kit
installation from
http://github.com/oneclick/rubyinsta...evelopment-Kit. Of
course, I do have the mkmf.rb file (which is around 40 pages) but not
the log. Maybe I missed a step when installing the developer?

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Heesob Park
Guest
Posts: n/a
 
      10-26-2010
Hi,

2010/10/26 Dd Dd <>
>
> Anyway, does anyone have any idea what the problem might be? =C2=A0It say=

s
> that one problem might be a lack of libraries or headers. =C2=A0I think i=

t
> failed when it reached this point: checking for termios.h... no
> *** extconf.rb failed ***
>
> I know that the termios.h fileis associated with UNIX specifically for
> serial port operations. =C2=A0It seems to be different in Windows, but Ru=

by
> doesn't seem to detect the equivalent file.
>
> Also, do I need to download C to get Ruby to work? =C2=A0Thanks.
>


According to the document at project's
homepage(http://ruby-serialport.rubyforge.org/)

"It support POSIX (Linux, *BSD, Solaris, AIX, Mac OS X), Cygwin and
native Windows. The native Windows version of this library supports
Microsoft=E2=80=98s Visual C++ and Borland=E2=80=98s C++ compilers."

You cannot build and install ruby-serialport with MinGW Development Kit.
And even worse, the current ruby-serialport 0.7.0 is not compatible
with Ruby 1.9.x

There is another patched
ruby-serialport(http://github.com/hparra/ruby-serialport)
And you can install it like this

gem install serialport

The whole story is here
http://www.ruby-forum.com/topic/203540

Regards,
Park Heesob

 
Reply With Quote
 
Luis Lavena
Guest
Posts: n/a
 
      10-26-2010
On Oct 26, 10:11*am, Dd Dd <d...@njit.edu> wrote:
> I don't think I got an mkmf.log file, but I followed the development kit
> installation fromhttp://github.com/oneclick/rubyinstaller/wiki/Development-Kit. *Of
> course, I do have the mkmf.rb file (which is around 40 pages) but not
> the log. *Maybe I missed a step when installing the developer?
>


Please verify the steps and the test invocation (gem install rdiscount
--platform=ruby)

If that didn't work either the devkit was not installed properly or
there is something messing with gem compilation in your computer.

The file mkmf.log is generated in the directory reported by gem
install, "Gem files will remain installed in C:/Users/Deepak/Ruby192/
lib/ruby/gems/1.9.1/gems/ruby-serialport-0.7.0 for inspection."

You need to look inside that folder and child folders for mkmf.log and
look into its contents.

--
Luis Lavena
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
emulate a serial port in windows (create a virtual 'com' port) Pom Python 2 01-31-2007 07:49 PM
Serial Port(COM)Port Saref Aref Computer Information 2 02-14-2005 07:38 AM
Can I connect router Serial interface directly to a PC serial port? Faustino Dina Cisco 2 08-18-2004 02:30 AM
Re: Serial port and PS/2 port schematics OR Assistive Tech. suggestion naive.verizon@locality.net Computer Support 1 07-10-2003 11:46 AM
Re: Serial port and PS/2 port schematics °Mike° Computer Support 1 07-09-2003 10:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57