# ScITE Question

**URL:** <https://www.ruby-forum.com/t/scite-question/173867>\
**Category:** Rails\
**Created:** [August 17, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/scite-question/173867 "2009-08-17T12:27:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Young\_Ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/49beb7/32.png) [@Young\_Ben](https://www.ruby-forum.com/u/Young_Ben)\
**Post date:** [August 17, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/scite-question/173867/1 "2009-08-17T12:27:29Z")

</div>

I’m a newbie & am just learning to use Ruby. I’ve chosen ScITE as my  
editor. So far so good, writing scripts then executing them inside  
ScITE using ‘F5’.

when I run this in ScITE

puts “Hello, world. What is your name?”  
myname = gets()  
puts "Well, hello there " + myname + “.”

All that happens is the ruby.exe window pops up & sits there blank.

If I name the above script “banana1.rb”, save it to C:\rubyprograms

& then run the program from the command prompt it runs fine.

eg:

c:\rubyprograms\> ruby banana1.rb  
Hello, world. What is your name?"  
OneBanana  
Well, hello there OneBanana

Why won’t it run in ScITE?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Young\_Ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/49beb7/32.png) [@Young\_Ben](https://www.ruby-forum.com/u/Young_Ben)\
**Post date:** [August 17, 2009, 3:47pm UTC](https://www.ruby-forum.com/t/scite-question/173867/2 "2009-08-17T15:47:41Z")

</div>

Have you asked here: [http://groups.google.com/group/scite-interest](http://groups.google.com/group/scite-interest)

---

<div class="post-metadata">

**Author:** ![Young\_Ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/49beb7/32.png) [@Young\_Ben](https://www.ruby-forum.com/u/Young_Ben)\
**Post date:** [August 17, 2009, 9:14pm UTC](https://www.ruby-forum.com/t/scite-question/173867/3 "2009-08-17T21:14:54Z")

</div>

Not yet, I joined last night & have just been accepted. Will try there  
now, thanks, Steve.

---

<div class="post-metadata">

**Author:** ![Young\_Ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/49beb7/32.png) [@Young\_Ben](https://www.ruby-forum.com/u/Young_Ben)\
**Post date:** [October 1, 2009, 9:41am UTC](https://www.ruby-forum.com/t/scite-question/173867/4 "2009-10-01T09:41:57Z")

</div>

SciTE is a wonderful ide, unfortunately it does not take well to input  
in its output panel. While the output panel can handle plenty of shell  
commands, in general it was not implemented in SciTE to handle many  
input situations, not just the ones that ruby presents.

After spending many cumulative hours searching for a fix or workaround  
and being left without even a hint on how to make it work, I decided  
to create my own workaround. What the below does is launches an xterm  
for your input and output, but if ruby has an error, its sent to Scite  
so you can use the line highlight feature.

In windows you’ll have to find your own solution, but in linux you can  
do the following:

1. First off we need to change the command that launches ruby. Using  
the SciTe Menu  
Options-\>Edit Properties-\>Open ruby.properties

## You will see the lines near the bottom:

## if PLAT\_GTK command.go.\*.rb=ruby $(FileNameExt)

change the command.go to:  
-=-=-=-=-=-=-=-=-  
command.go.\*.rb=xterm -hold -e /usr/bin/sciteredirection\_for\_ruby.sh $  
(FileNameExt)  
=-=-=-=-=-=-=-=-=

1. then save and chmod 755 the following shell script to /usr/bin/  
sciteredirection\_for\_ruby.sh

=-=-=-=-=  
#! /bin/bash  
ruby $1 2\> /proc/$PPID/fd/2  
=-=-=-=-=

I use xterm instead of konsole or other terminals because SciTE gets  
the exit code immediately after closing, and xterm shuts off input  
after ruby terminates.

If anybody knows a more cross-platform solution, can patch the SciTE  
code itself, or even knows a better way to do the above, I’d like to  
know.
