用 rails 写了一个简单应用,使用 aliyun-oss-sdk-for-ruby 碰到如下错误,
/home/vagrant/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/aliyun-oss-0.7.0.1397365150/lib/aliyun/oss/extensions.rb:224: `@@{' is not allowed as a class variable name
/home/vagrant/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/aliyun-oss-0.7.0.1397365150/lib/aliyun/oss/extensions.rb:224: syntax error, unexpected end-of-input
unless defined? @@{:instance_writer=>false}
^ (SyntaxError)
源代码在此 (221 行起)
class Class # :nodoc:
def cattr_reader(*syms)
syms.flatten.each do |sym|
class_eval(<<-EOS, __FILE__, __LINE__)
unless defined? @@#{sym}
@@#{sym} = nil
end
def self.#{sym}
@@#{sym}
end
def #{sym}
@@#{sym}
end
EOS
end
end
先把问题放到这里,看哪位大侠能解救我。明天继续搞,