From: Ahmed Abdelsalam Date: 2009-04-23T01:16:02+09:00 Subject: Re: JRuby problem James Herdman wrote: > My guess is that the context fails to keep track of local variables. Try > an > experiment with something simpler: > > ScriptContext sct = jruby.getContext > jruby.eval("name = 'Ahmed'") > jruby.eval('puts "My name is #{name}"') > > If things explode, my theory is correct. > > James > > PS: Semi-colons aren't required, nor are empty parenthesis. It's > considered > out of the Ruby norm to use them. As such, I'd avoid them in your > coding. > See http://www.pathf.com/blogs/ruby-and-rails-style-guide/ Thanks for response. the code you sent is missing using sct, but I updated it: ScriptContext sct = jruby.getContext(); jruby.eval("name = 'Ahmed'", sct); jruby.eval("puts \"My name is #{name}\"", sct); also not working, the same error: undefined local variable or method `name' for main:Object PS: Semi-colon is required by java code -- Posted via http://www.ruby-forum.com/.