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:
-Jeremy
···
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.
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-18) [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.
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
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.
I don't think I got an mkmf.log file, but I followed the development kit
installation from http://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?
I uninstalled Ruby 1.9.2 and then installed Ruby 1.9.1 before. This
time, I'll install an earlier version of Ruby to see if it will work.
I'll post my experience with this soon.
I just installed Ruby 1.8.7 and DevKit 3.4.5; Using the instructions
from http://github.com/oneclick/rubyinstaller/wiki/Development-Kit, I
entered ruby dk.rb init in the command prompt. Initialization was
successful, and now I looked up the config.yml file, which is as
follows:
# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
I think I got it to work; I followed all the DevKit installation
instructions, and have gotten the and the one thing I forgot to do was
add --platform=ruby at the end of the command. This time, I entered
"gem install serialport --platform=ruby", and it seems to have worked,
installing serial port version 1.0.4. Is this the latest version of the
serial port? Thanks.
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?
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.
"It support POSIX (Linux, *BSD, Solaris, AIX, Mac OS X), Cygwin and
native Windows. The native Windows version of this library supports
Microsoft‘s Visual C++ and Borland‘s 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
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.
···
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?
Now just "ruby dk.rb install" and then look at the ruby-serialport
variant that works on Windows.
···
On Oct 27, 12:42 am, Dd Dd <d...@njit.edu> wrote:
I just installed Ruby 1.8.7 and DevKit 3.4.5; Using the instructions
fromhttp://github.com/oneclick/rubyinstaller/wiki/Development-Kit, I
entered ruby dk.rb init in the command prompt. Initialization was
successful, and now I looked up the config.yml file, which is as
follows:
# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
#
# Example:
#
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
#
---
- C:/Users/Deepak/Ruby187