Are you defining the code_words variable as a local or instance 
variable. You should do:

bash> cat code.rb
@code_words = [ 'word1', 'word2' ]

bash> cat word.rb
#!/usr/bin/env ruby

require 'code'
@code_words += [ 'word3' ]
puts @code_words

bash> ruby word.rb
word1
word2
word3

-- 
Posted via http://www.ruby-forum.com/.