Weird error - illegal instruction

I’m getting this weird error when I try to run the following code.
The strange thing is on my development machine ( mac osx on locomotive)
it runs fine but on the production machine ( linux box) it spits out
illegal instruction (core dumped) error.

Now I have net/ssh gem installed on production machine.
Any suggesstions is appreciated.
Thanks,
Dev.

------------begine code------------------------------
require ‘rubygems’
require ‘net/ssh’

def subscribe_user

  #User added to distribution list
  Net::SSH.start('xyz', 'username', 'pwd') do |session|
    shell = session.shell.sync
    out = shell.sudo "-u abcdedf"
    p out.stdout
    p out.status
    p out.stderr
    shell.exit
    if out.status == 0
      @user_in_group.save
      redirect_to :action => 'home', :homestring => 'You were

successfully subscribed to the mailing list’
else
redirect_to :action => ‘home’, :homestring => ‘Unable to
subscribe from the mailing list, Please try again later’
end

  end

end
--------------end code----------------