Can't get Ruby programs to work from Command Prompt

Hello; I'm having a problem running Ruby programs through the command
prompt. I have a Ruby program called scope.rb, which is a simple
oscilloscope which runs using an Arduino platform, and I enter "ruby
scope.rb", but I get the following message (the file is in the bin
folder:

ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

C:\Users\Deepak>cd Ruby192

C:\Users\Deepak\Ruby192>cd bin

C:\Users\Deepak\Ruby192\bin>ruby scope.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to
load --
tk (LoadError)
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from scope.rb:1:in `<main>'

When entering just "scope" or "scope.rb", I of course get a text file of
the code. The problem is that the Ruby is installed as part of the Path
variable, yet I still get these errors. The Path variable is as
follows:
"C:\Users\Deepak\Ruby192\bin;%CommonProgramFiles%\Microsoft
Shared\Windows Live". Is there a problem with the Path syntax? Any
help would be appreciated. Thank you.

···

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

try to download ruby from this site than it might work

http://www.ruby-lang.org/en/

···

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

tk (LoadError)
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from scope.rb:1:in `<main>'

Your Ruby installation simply misses the Tk library. The RubyInstaller
team doesn't provide it. If you have the RubyInstaller Team's Devkit
installed, you may try to install Tk by

gem install tk_as_gem

And please don't save your Ruby scripts in Ruby's bin/ directory!

try to download ruby from this site than it might work

Ruby Programming Language

No, it won't. He's on Windows and likely doesn't have a C compiler. And
the binaries provided at ruby-lang.org are compiled with the Microsoft
Visual C/C++ compiler, which isn't the recommanded Ruby on Windows
anymore (the MinGW-compiled one provided by the RubyInstaller team at
http://rubyinstaller.org now is it).

Vale,
Marvin

···

Am 15.11.2010 10:37, schrieb Dd Dd:

So, I must know download the tk library, right? Thanks.

···

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

Okay, I just downloaded ActiveTcl 8.5.9. As part of its library, it has
a file tk8.5. Would this be the appropriate download? Also, what
should I do next to properly install the tk library? Thanks.

···

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

All right, I tried installing tk on the command line by entering "gem
install tk_as_gem", and I got the following:

ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

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

C:/Users/Deepak/Ruby192/bin/ruby.exe extconf.rb
checking for ruby_native_thread_p() in ruby.h... yes
checking for rb_errinfo() in ruby.h... yes
checking for rb_safe_level() in ruby.h... yes
checking for struct RArray.ptr in ruby.h... no
checking for struct RArray.len in ruby.h... no
checking for tcl.h... no
checking for tcl.h in
/usr/local/include,/usr/pkg/include,/usr/include,/Tcl/incl
ude,/usr/local/include/tcl8.4,/usr/pkg/include/tcl8.4,/usr/include/tcl8.4,/Tcl/i
nclude/tcl8.4,/usr/local/include/tcl8.7,/usr/pkg/include/tcl8.7,/usr/include/tcl
8.7,/Tcl/include/tcl8.7,/usr/local/include/tcl8.6,/usr/pkg/include/tcl8.6,/usr/i
nclude/tcl8.6,/Tcl/include/tcl8.6,/usr/local/include/tcl8.5,/usr/pkg/include/tcl
8.5,/usr/include/tcl8.5,/Tcl/include/tcl8.5,/usr/local/include/tcl8.3,/usr/pkg/i
nclude/tcl8.3,/usr/include/tcl8.3,/Tcl/include/tcl8.3,/usr/local/include/tcl8.2,
/usr/pkg/include/tcl8.2,/usr/include/tcl8.2,/Tcl/include/tcl8.2,/usr/local/inclu
de/tcl8.1,/usr/pkg/include/tcl8.1,/usr/include/tcl8.1,/Tcl/include/tcl8.1,/usr/l
ocal/include/tcl8.0,/usr/pkg/include/tcl8.0,/usr/include/tcl8.0,/Tcl/include/tcl
8.0,/usr/local/include/tcl7.6,/usr/pkg/include/tcl7.6,/usr/include/tcl7.6,/Tcl/i
nclude/tcl7.6... no
checking for tk.h... no
checking for tk.h in
/usr/local/include,/usr/pkg/include,/usr/include,/Tcl/inclu
de,/usr/local/include/tk8.4,/usr/pkg/include/tk8.4,/usr/include/tk8.4,/Tcl/inclu
de/tk8.4,/usr/local/include/tk8.7,/usr/pkg/include/tk8.7,/usr/include/tk8.7,/Tcl
/include/tk8.7,/usr/local/include/tk8.6,/usr/pkg/include/tk8.6,/usr/include/tk8.
6,/Tcl/include/tk8.6,/usr/local/include/tk8.5,/usr/pkg/include/tk8.5,/usr/includ
e/tk8.5,/Tcl/include/tk8.5,/usr/local/include/tk8.4,/usr/pkg/include/tk8.4,/usr/
include/tk8.4,/Tcl/include/tk8.4,/usr/local/include/tk8.3,/usr/pkg/include/tk8.3
,/usr/include/tk8.3,/Tcl/include/tk8.3,/usr/local/include/tk8.2,/usr/pkg/include
/tk8.2,/usr/include/tk8.2,/Tcl/include/tk8.2,/usr/local/include/tk8.1,/usr/pkg/i
nclude/tk8.1,/usr/include/tk8.1,/Tcl/include/tk8.1,/usr/local/include/tk8.0,/usr
/pkg/include/tk8.0,/usr/include/tk8.0,/Tcl/include/tk8.0,/usr/local/include/tk4.
2,/usr/pkg/include/tk4.2,/usr/include/tk4.2,/Tcl/include/tk4.2... 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
        --with-tcl-framework-header
        --without-tcl-framework-header
        --with-tk-framework-header
        --without-tk-framework-header
        --with-tcltk-framework
        --without-tcltk-framework
        --enable-tcltk-framework
        --disable-tcltk-framework
        --enable-mac-tcltk-framework
        --disable-mac-tcltk-framework
        --with-tk-dir
        --without-tk-dir
        --with-tk-include
        --without-tk-include=${tk-dir}/include
        --with-tk-lib
        --without-tk-lib=${tk-dir}/lib
        --with-tcl-dir
        --without-tcl-dir
        --with-tcl-include
        --without-tcl-include=${tcl-dir}/include
        --with-tcl-lib
        --without-tcl-lib=${tcl-dir}/lib
        --with-X11-dir
        --without-X11-dir
        --with-X11-include
        --without-X11-include=${X11-dir}/include
        --with-X11-lib
        --without-X11-lib=${X11-dir}/lib
        --with-tk-lib
        --without-tk-lib
        --with-tcl-lib
        --without-tcl-lib
        --with-X11-lib
        --without-X11-lib
        --with-tklib
        --without-tklib
        --with-tcllib
        --without-tcllib
        --enable-tcltk_stubs
        --disable-tcltk_stubs
        --with-tcltk_stubs
        --without-tcltk_stubs
        --with-tcltkversion
        --without-tcltkversion
        --with-X11
        --without-X11

Gem files will remain installed in
C:/Users/Deepak/Ruby192/lib/ruby/gems/1.9.1/g
ems/tk_as_gem-0.1.0 for inspection.
Results logged to
C:/Users/Deepak/Ruby192/lib/ruby/gems/1.9.1/gems/tk_as_gem-0.1
.0/ext/gem_make.out

Also, where do I look for the mkmf.log file? I'm not experienced with
this, and it's getting very frustrating. Any help would be appreciated.
Thanks.

···

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

I know for a fact that tk is available; I downloaded it by entering "gem
fetch tk_as_gem" and it says it downloaded. The only problem is the
installation. It says that I may need configuration options; how do I
set those on the command line (what is the syntax). I'm wondering if I
should just uninstall Ruby 1.9.2 and install an earlier version
(pre-1.9) of Ruby.

···

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

RubyInstaller *is* linked in ruby-lang.org website, so even download
form ruby-lang will download RubyInstaller.

Tk/Tcl is not provided by RubyInstaller at this time, contributions to
automate the compilation of it haven't been 100% sucessful.

We can't integrate a tool to the build process of Ruby that we can't
automate and do not pollute the RubyInstaller developer environment.

Search RubyInstaller group about it.

http://groups.google.com/group/rubyinstaller/

···

On Nov 15, 6:58 am, Quintus <sutn...@gmx.net> wrote:

No, it won't. He's on Windows and likely doesn't have a C compiler. And
the binaries provided at ruby-lang.org are compiled with the Microsoft
Visual C/C++ compiler, which isn't the recommanded Ruby on Windows
anymore (the MinGW-compiled one provided by the RubyInstaller team athttp://rubyinstaller.orgnow is it).

--
Luis Lavena

The same message advising you to do an install of TK as a gem also
advised you to get the Ruby DevKit.

···

On Wed, Nov 17, 2010 at 12:23 PM, Dd Dd <dd25@njit.edu> wrote:

I know for a fact that tk is available; I downloaded it by entering "gem
fetch tk_as_gem" and it says it downloaded. The only problem is the
installation. It says that I may need configuration options; how do I
set those on the command line (what is the syntax). I'm wondering if I
should just uninstall Ruby 1.9.2 and install an earlier version
(pre-1.9) of Ruby.

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.

I know for a fact that tk is available; I downloaded it by entering "gem
fetch tk_as_gem" and it says it downloaded. The only problem is the
installation. It says that I may need configuration options; how do I
set those on the command line (what is the syntax). I'm wondering if I
should just uninstall Ruby 1.9.2 and install an earlier version
(pre-1.9) of Ruby.

The project's readme lists some configuration options.

Hope that helps.

···

On Wed, Nov 17, 2010 at 5:23 AM, Dd Dd <dd25@njit.edu> wrote:

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