S.D
10/30/2007 5:24:00 PM
ajalkane wrote:
> On Oct 29, 11:36 pm, "S.D" <s...@comcast.net> wrote:
>
>> bash-/public$ ruby WM5.rb
>> /usr/lib/ruby/site_ruby/1.8/rubygems.rb:432:in `method_missing':
>> undefined method `exists?' for File:Class (NoMethodError)
>> ...
>> If this is common for Ruby 1.9 or if it is a result of some further
>> setup I need to take care of, please point it out to me. The errors all
>> point to rubygems, so I'd assume that others have encountered this
>> problem. Questions like: "Do gems need to be reinstalled, moved or just
>> pointed to some environment variable?" come to mind.
>> This same code runs without error(s) when I start it with Ruby 1.8.6.
>>
>
> File.exists? has been deprecated in favor of File.exist?
>
Why should something as simple as this cause legacy code to break? And
why not provide syntactic "sugar" so that this type of change does no
harm? I guess I'm a bit "old school", but breaking legacy code is never
a good thing and should be done only for very good reasons.
Now, I'll have to do ruby version detection in several server
deployments and branch the code accordingly. ARRRGGGGG!
That being said, I have a deep appreciation for all of the work that
Matz and others have done to make Ruby what it is today. I just hope we
make "not breaking" legacy code a priority as the language continues to
evolve.
-- Steve Downie