# Why ":symbol" failed but 'symbol' successed with JRuby 1.0.3?

**URL:** <https://www.ruby-forum.com/t/why-symbol-failed-but-symbol-successed-with-jruby-1-0-3/140803>\
**Category:** Ruby\
**Created:** [June 18, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/why-symbol-failed-but-symbol-successed-with-jruby-1-0-3/140803 "2008-06-18T19:16:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Song\_Ma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b2d939/32.png) [@Song\_Ma](https://www.ruby-forum.com/u/Song_Ma)\
**Post date:** [June 18, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/why-symbol-failed-but-symbol-successed-with-jruby-1-0-3/140803/1 "2008-06-18T19:16:29Z")

</div>

Hi,

I was running the test cases from Rails 1.2.6 Action Pack. The full text  
of test is  
here[http://svn.rubyonrails.org/rails/branches/1-2-stable/actionpack/test/controller/test\_test.rb](http://svn.rubyonrails.org/rails/branches/1-2-stable/actionpack/test/controller/test_test.rb).  
There is one case like this:

def test\_process\_with\_session\_arg  
process :no\_op, nil, { ‘string’ =\> ‘value1’, :symbol =\> ‘value2’ }  
assert\_equal ‘value1’, session[‘string’]  
assert\_equal ‘value1’, session[:string]  
assert\_equal ‘value2’, session[‘symbol’]  
assert\_equal ‘value2’, session[:symbol]  
end  
I was using JRuby 1.0.3 on a UNIX platform, to my surprised this case  
only  
first assert passed and all other three failed. The error message says  
“ expected but was ”

After I changed ":symbol =\> ‘value2’ " to " ‘symbol’ =\> ‘value2’ ",  
assert 1  
and 3 passed but 2 and 4 were always failed. The error message was the  
same.

These tests were passed on my Gentoo box with JRuby 1.0.3. The JVM are  
the  
same Java5.0.

What could be wrong for it? Theoratically JRuby is platform independent  
and  
I was using the same version of JVM on both UNIX and Gentoo. Why  
‘symbol’  
works but :symbol failed?

Thanks,  
Song Ma

---

<div class="post-metadata">

**Author:** ![Song\_Ma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b2d939/32.png) [@Song\_Ma](https://www.ruby-forum.com/u/Song_Ma)\
**Post date:** [June 19, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/why-symbol-failed-but-symbol-successed-with-jruby-1-0-3/140803/2 "2008-06-19T23:12:14Z")

</div>

> What could be wrong for it? Theoratically JRuby is platform independent  
> and  
> I was using the same version of JVM on both UNIX and Gentoo. Why  
> ‘symbol’  
> works but :symbol failed?  
> might want to ask the jruby group  
> -R

---

<div class="post-metadata">

**Author:** ![Song\_Ma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b2d939/32.png) [@Song\_Ma](https://www.ruby-forum.com/u/Song_Ma)\
**Post date:** [July 20, 2008, 6:14am UTC](https://www.ruby-forum.com/t/why-symbol-failed-but-symbol-successed-with-jruby-1-0-3/140803/3 "2008-07-20T06:14:25Z")

</div>

Song Ma wrote:

> ```
> assert_equal 'value2', session['symbol']
> 
> ```
> 
> same Java5.0.  
> You really ought to be using JRuby 1.1.x…1.0.3 is the last maintenance  
> release to 1.0 and that line has not seen any updates in over a year.  
> 1.1 just had a 1.1.3 release that’s worlds better as far as  
> compatibility and far faster. If this bug still exists in JRuby 1.1.3,  
> please file an issue for it 🙂

[http://jira.codehaus.org/browse/JRUBY](http://jira.codehaus.org/browse/JRUBY)

- Charlie
