Fix for ruby 1.8.7 incompatibity

Last week i moved from ruby version 1.8.6 to 1.8.7.
then over a week i found that my 1.2.3 and applications developed in ruby 1.8.6 are not working in ruby 1.8.7.

From lot of search on google, i found that its issue with ruby 1.8.7.

Then, i started searching fix / solution for this incompatibity.
And, Finally i got solution.

We just need to fix file delegate.rb
here is fix

Diff of /branches/ruby_1_8_7/lib/delegate.rb

--- branches/ruby_1_8_7/lib/delegate.rb	2008/05/31 15:17:53	16732
+++ branches/ruby_1_8_7/lib/delegate.rb 2008/06/02 10:52:07 16756
@@ -163,9 +163,9 @@
# Checks for a method provided by this the delegate object by fowarding the

# call through \_\_getobj\_\_.
#
- def respond_to?(m)
+ def respond_to?(m, include_private = false)
return true if super
- return self.__getobj__.respond_to?(m)
+ return self.__getobj__.respond_to?(m, include_private)

end

#
@@ -270,9 +270,9 @@
end
@_dc_obj.__send__(m, *args)
end
- def respond_to?(m) # :nodoc:
+ def respond_to?(m, include_private = false) # :nodoc:
return true if super

- return @_dc_obj.respond_to?(m)
+ return @_dc_obj.respond_to?(m, include_private)
end
def __getobj__ # :nodoc:
@_dc_obj


You have to make necessary changes and you are ready to work with ruby 1.8.7.
need not downgrade ruby version 🙂

for Hash error

Add following line in config/environment.rb
unless '1.9'.respond_to?(:force_encoding)
String.class_eval do
begin
remove_method :chars
rescue NameError
# OK
end
end
end

Cheers !

Sandip

Advertisements

About sandipransing

Web Developer #ruby #rails #JS
This entry was posted in Ruby and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s