Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Can't get Ruby programs to work from Command Prompt

Reply
Thread Tools

Can't get Ruby programs to work from Command Prompt

 
 
Dd Dd
Guest
Posts: n/a
 
      11-15-2010
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-1 [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/.

 
Reply With Quote
 
 
 
 
Lark Work
Guest
Posts: n/a
 
      11-15-2010
try to download ruby from this site than it might work

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

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

 
Reply With Quote
 
 
 
 
Quintus
Guest
Posts: n/a
 
      11-15-2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 15.11.2010 10:37, schrieb Dd Dd:
> 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
>
> http://www.ruby-lang.org/en/


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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJM4QRaAAoJEGrS0YjAWTKVWUQH/39fjXPf/Z7T76BiYmsdzcIF
cK/9z1QbVeZM1bFhJu0k+vZiszyCBr2Yz8m5K+hUp5vNZFnpLBTxk VYQ1Og5ldy9
D3Ldwv7mdmpSUaW1r0mKCSTyplgv0zcSXZMHOHhv8HnAvjcdh0 GypFK0ysMI/LGq
mcVzWtq9A8ahkkT4RkbMNz6aUV4PF+EylvtHOYXATeGEtYnVuq KUOb2H0Cc1vdXK
i/jMDKBGvln0Fd/3X3m+QUftqMlpefrxPJFEMjQKcYDk7MXR/nIbhhI3Y1L4EgDe
2DwuolWXdDpQPt3e8ELzVJN23odyDnZCKnM1T/Op9LCgUfSX4vqyxqDlA4hfKUE=
=OyMj
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Luis Lavena
Guest
Posts: n/a
 
      11-15-2010
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).
>


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/

--
Luis Lavena
 
Reply With Quote
 
Dd Dd
Guest
Posts: n/a
 
      11-16-2010
So, I must know download the tk library, right? Thanks.

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

 
Reply With Quote
 
Dd Dd
Guest
Posts: n/a
 
      11-16-2010
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/.

 
Reply With Quote
 
Dd Dd
Guest
Posts: n/a
 
      11-17-2010
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-1 [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/.

 
Reply With Quote
 
Dd Dd
Guest
Posts: n/a
 
      11-17-2010
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/.

 
Reply With Quote
 
Phillip Gawlowski
Guest
Posts: n/a
 
      11-17-2010
On Wed, Nov 17, 2010 at 12:23 PM, Dd Dd <> 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. =A0The only problem is the
> installation. =A0It says that I may need configuration options; how do I
> set those on the command line (what is the syntax). =A0I'm wondering if I
> should just uninstall Ruby 1.9.2 and install an earlier version
> (pre-1.9) of Ruby.


The same message advising you to do an install of TK as a gem also
advised you to get the Ruby DevKit.
--=20
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.

 
Reply With Quote
 
Gordon Thiesfeld
Guest
Posts: n/a
 
      11-17-2010
[Note: parts of this message were removed to make it a legal post.]

On Wed, Nov 17, 2010 at 5:23 AM, Dd Dd <> 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.
>
>

The project's readme lists some configuration options.

https://github.com/rdp/tk_as_gem

Hope that helps.


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


 
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
javac command not working in command prompt chrisdude911 Java 10 03-10-2009 09:55 AM
How to open a shell prompt from an existing shell prompt gaurav kashyap Python 2 10-30-2008 09:18 AM
Running compiled programs in command prompt Albert Java 6 12-20-2007 01:48 PM
I'm wanted to know how to run several programs for a game under the command prompt judith Java 9 11-06-2006 07:44 PM
Access Denied when i type command at command prompt calvin MCDST 0 03-08-2006 06:33 AM



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