# Little compatibility issue with Ruby 1.9 (rb\_argv variable)

**URL:** <https://www.ruby-forum.com/t/little-compatibility-issue-with-ruby-1-9-rb-argv-variable/137962>\
**Category:** Ruby-Gnome 2\
**Created:** [May 18, 2008, 11:13pm UTC](https://www.ruby-forum.com/t/little-compatibility-issue-with-ruby-1-9-rb-argv-variable/137962 "2008-05-18T23:13:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpedrosa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jpedrosa](https://www.ruby-forum.com/u/jpedrosa)\
**Post date:** [May 18, 2008, 11:13pm UTC](https://www.ruby-forum.com/t/little-compatibility-issue-with-ruby-1-9-rb-argv-variable/137962/1 "2008-05-18T23:13:09Z")

</div>

Hey guys,

Today I was installing things on my newly installed Ubuntu Hardy Heron  
system, and I gave Ruby-GNOME2 a try with Ruby 1.9, but  
found out some issue, which was fixed as follows (my C is weak so I  
had to learn on my own that the macro recently introduced in Ruby 1.9  
was causing the issue):

# Index: gtk/src/rbgtkmain.c

— gtk/src/rbgtkmain.c (revisÃ£o 3214)  
+++ gtk/src/rbgtkmain.c (cÃ³pia de trabalho)  
@@ -105,10 +105,8 @@  
rb\_scan\_args(argc, argv, “01”, &argary);

```
 if (NIL_P(argary)){

```

- 

```
   VALUE rb_argv;

```

- 

```
   rb_argv = rb_const_get(rb_cObject, rb_intern("ARGV"));

```

- 

```
   gargc = RARRAY(rb_argv)->len;

```

- 

```
   argary = rb_argv;

```

- 

```
   argary = rb_const_get(rb_cObject, rb_intern("ARGV"));

```

- 

```
   gargc = RARRAY(argary)->len;

```

} else {  
Check\_Type(argary, T\_ARRAY);  
gargc = RARRAY(argary)-\>len;  
Index: gstreamer/src/rbgst.c  
===================================================================  
— gstreamer/src/rbgst.c (revisÃ£o 3214)  
+++ gstreamer/src/rbgst.c (cÃ³pia de trabalho)  
@@ -163,10 +163,8 @@  
rb\_scan\_args (argc, argv, “01”, &argary);

if (NIL\_P (argary)) {

- VALUE rb\_argv;
- 

```
   rb_argv = rb_const_get(rb_cObject, rb_intern("ARGV"));

```

- 

```
   gargc = RARRAY(rb_argv)->len;

```

- 

```
   argary = rb_argv;

```

- 

```
   argary = rb_const_get(rb_cObject, rb_intern("ARGV"));

```

- 

```
   gargc = RARRAY(argary)->len;

```

} else {  
Check\_Type (argary, T\_ARRAY);  
gargc = RARRAY (argary)-\>len;

That is, rb\_argv was probably being replaced with a function  
(rb\_get\_argv) or something. The fix  
was just to make use of the already available argary variable sooner.

Thanks for the continued work on this great project!

Cheers,  
Joao

---

<div class="post-metadata">

**Author:** ![jpedrosa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jpedrosa](https://www.ruby-forum.com/u/jpedrosa)\
**Post date:** [May 20, 2008, 4:28pm UTC](https://www.ruby-forum.com/t/little-compatibility-issue-with-ruby-1-9-rb-argv-variable/137962/2 "2008-05-20T16:28:06Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Little compatibility issue with Ruby 1.9  
(rb\_argv variable)” on Sun, 18 May 2008 18:12:24 -0300,  
“Joao P.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Today I was installing things on my newly installed Ubuntu Hardy Heron  
> system, and I gave Ruby-GNOME2 a try with Ruby 1.9, but  
> found out some issue, which was fixed as follows (my C is weak so I  
> had to learn on my own that the macro recently introduced in Ruby 1.9  
> was causing the issue):

Thanks.  
I’ve applied your patch.

–  
kou
