From: Ahmed Abdelsalam Date: 2009-04-23T00:45:19+09:00 Subject: JRuby problem Hi,... I'm trying to execute the following lines: ScriptContext sct = jruby.getContext(); jruby.eval("sheet = Spreadsheet.new", sct); jruby.eval("sheet.cells.a1 = 'Welcome'", sct); The first two lines are executed correctly, but the last one gives the following error: undefined local variable or method `sheet' for main:Object it indicates that sheet is undefined although it's defined in line 2. When I try to execute both commands in a single statement like: jruby.eval("sheet = Spreadsheet.new \n sheet.cells.a1 = 'Welcome'", sct); The statement is executed correctly. Please help Regards,... Ahmed -- Posted via http://www.ruby-forum.com/.