# Win32/Process at win32utils

**URL:** <https://www.ruby-forum.com/t/win32-process-at-win32utils/88816>\
**Category:** Ruby\
**Created:** [March 14, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/win32-process-at-win32utils/88816 "2007-03-14T17:56:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zemariamm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/58956e/32.png) [@zemariamm](https://www.ruby-forum.com/u/zemariamm)\
**Post date:** [March 14, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/win32-process-at-win32utils/88816/1 "2007-03-14T17:56:57Z")

</div>

Hi guys, I’ve made a simple program to test the Process.create:

require ‘rubygems’  
require ‘win32/process’

pgname = “C:\Program Files\VideoLAN\VLC\vlc.exe”  
x = Process.create :app\_name =\> pgname.to\_s  
sleep 5  
Process.kill(1,x)

This works fine, but if a add at the begining  
require\_gem ‘activerecord’

I get a  
testBug.rb:8: [BUG] Segmentation fault  
ruby 1.8.4 (2006-04-14) [i386-mswin32]

(i get the segfault at the “Process.kill” line…) any ideas ?  
I’m on a Windows XP Pro Edition , Service Pack 2 using ruby 1.8.4

Tks in advance,  
Ze Maria

---

<div class="post-metadata">

**Author:** ![zemariamm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/58956e/32.png) [@zemariamm](https://www.ruby-forum.com/u/zemariamm)\
**Post date:** [March 14, 2007, 8:16pm UTC](https://www.ruby-forum.com/t/win32-process-at-win32utils/88816/2 "2007-03-14T20:16:02Z")

</div>

On Mar 14, 10:56 am, Ze Maria [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi guys, I’ve made a simple program to test the Process.create:
> 
> require ‘rubygems’  
> require ‘win32/process’
> 
> pgname = “C:\Program Files\VideoLAN\VLC\vlc.exe”  
> x = Process.create :app\_name =\> pgname.to\_s  
> sleep 5  
> Process.kill(1,x)

What version of win32-process are you using? As of 0.5.0 the  
Process.create method returns a ProcessInfo struct. So, your code  
should look like this:

Process.kill(1, x.process\_id)

That may not be the issue, though, since you say it works fine until  
you add the active\_record gem. Can you provide the full backtrace?

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![zemariamm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/58956e/32.png) [@zemariamm](https://www.ruby-forum.com/u/zemariamm)\
**Post date:** [March 15, 2007, 5:19pm UTC](https://www.ruby-forum.com/t/win32-process-at-win32utils/88816/3 "2007-03-15T17:19:30Z")

</div>

Daniel B. wrote:

> On Mar 14, 10:56 am, Ze Maria [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Hi guys, I’ve made a simple program to test the Process.create:
> > 
> > require ‘rubygems’  
> > require ‘win32/process’
> > 
> > pgname = “C:\Program Files\VideoLAN\VLC\vlc.exe”  
> > x = Process.create :app\_name =\> pgname.to\_s  
> > sleep 5  
> > Process.kill(1,x)
> 
> What version of win32-process are you using? As of 0.5.0 the  
> Process.create method returns a ProcessInfo struct. So, your code  
> should look like this:
> 
> Process.kill(1, x.process\_id)
> 
> That may not be the issue, though, since you say it works fine until  
> you add the active\_record gem. Can you provide the full backtrace?
> 
> Regards,
> 
> Dan  
> Hi Daniel,

I’ve updated to win32-process 0.5.2:

"

D:\gem search win32-process

win32-process (0.5.2, 0.4.2)

Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method

"

I still ve the same problem… I triedwhat you said and i get:

testBug.rb:10: undefined method `process\_id’ for 1808:Fixnum  
(NoMethodError)

btw I’m using ruby 1.8.4 should I upgrade to 1.8.5 ?

Tks in advance,

Ze Maria

---

<div class="post-metadata">

**Author:** ![zemariamm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/58956e/32.png) [@zemariamm](https://www.ruby-forum.com/u/zemariamm)\
**Post date:** [March 15, 2007, 5:25pm UTC](https://www.ruby-forum.com/t/win32-process-at-win32utils/88816/4 "2007-03-15T17:25:54Z")

</div>

On Mar 15, 10:19 am, Ze Maria [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Process.kill(1,x)  
> > > you add the active\_record gem. Can you provide the full backtrace?
> 
> testBug.rb:10: undefined method `process\_id’ for 1808:Fixnum  
> (NoMethodError)

That’s odd. It looks like you’re still using the 0.4.2 gem. Do a “gem  
clean win32-process” and try again. Also, make sure you don’t have it  
installed manually somewhere else. You can validate by printing out  
the Process::WIN32\_PROCESS\_VERSION constant.

> btw I’m using ruby 1.8.4 should I upgrade to 1.8.5 ?

If it still doesn’t work go ahead and try upgrading to 1.8.5.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![zemariamm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/58956e/32.png) [@zemariamm](https://www.ruby-forum.com/u/zemariamm)\
**Post date:** [March 15, 2007, 7:05pm UTC](https://www.ruby-forum.com/t/win32-process-at-win32utils/88816/5 "2007-03-15T19:05:58Z")

</div>

Daniel B. wrote:

> On Mar 15, 10:19 am, Ze Maria [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > > Process.kill(1,x)  
> > > > you add the active\_record gem. Can you provide the full backtrace?
> > 
> > testBug.rb:10: undefined method `process\_id’ for 1808:Fixnum  
> > (NoMethodError)
> 
> That’s odd. It looks like you’re still using the 0.4.2 gem. Do a “gem  
> clean win32-process” and try again. Also, make sure you don’t have it  
> installed manually somewhere else. You can validate by printing out  
> the Process::WIN32\_PROCESS\_VERSION constant.
> 
> > btw I’m using ruby 1.8.4 should I upgrade to 1.8.5 ?
> 
> If it still doesn’t work go ahead and try upgrading to 1.8.5.
> 
> Regards,
> 
> Dan

Hi Dan,  
I did a  
“gem clean win32-process”  
which gave me:  
"  
D:\Work\workspace\VlmReconhecimento\>gem clean win32-process  
Cleaning up installed gems…  
Attempting uninstall on win32-process-0.4.2-mswin32  
Successfully uninstalled win32-process version 0.4.2  
Clean Up Complete  
"

now when I execute a  
gem search win32-process  
I get:  
D:\Work\workspace\VlmReconhecimento\>gem search win32-process

\*\*\* LOCAL GEMS \*\*\*

win32-process (0.5.2)  
Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method

Which I think, it’s good, now the only version I 've is the latest  
version

But I still 've the same problem…  
btw the command “puts Process::WIN32\_PROCESS\_VERSION” doesn’t works,  
I get an “uninitialized constant Process::WIN32\_PROCESS\_VERSION” error

Tks in advance  
Ze Maria
