Hi,
I'm a web developer and wanted to try ruby. I installed ruby 1.8 on my
debian server with eruby and mod_ruby for apache2. Apache config files
are configured correctly to accept .rhtml files and parse them. If I
type sth like <% print "Test" %> then there's no problem, it gives me
"Test" as output. But I wanted to try "Twitterland" from rubygems. I
installed the gem and when I'm trying to use the following:
require 'rubygems'
require 'twitterland'
print Twitterland::FollowCost.show('johnygoerend')
it works fine when I use it with "ruby index.rhtml", but when I call it
in my browser (of course with the <% %> tags) then I get these errors
in my error.log:
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: error in ruby
[Sun Sep 26 04:21:25 2010] [error] mod_ruby:
/usr/local/lib/site_ruby/1.8/rubygems.rb:472:in `[]': Insecure operation - [] (SecurityError)
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/local/lib/site_ruby/1.8/rubygems.rb:472:in `find_files'
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/local/lib/site_ruby/1.8/rubygems.rb:471:in `map'
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/local/lib/site_ruby/1.8/rubygems.rb:471:in `find_files'
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/local/lib/site_ruby/1.8/rubygems.rb:983:in `load_plugins'
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/local/lib/site_ruby/1.8/rubygems.rb:1139
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/lib/ruby/1.8/auto-reload.rb:77:in `load'
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/lib/ruby/1.8/auto-reload.rb:77:in `require'
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /var/www/virtual/johny.lu/ruby/htdocs/index.rhtml:2
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from (eval):0
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/lib/ruby/1.8/apache/eruby-run.rb:116:in `eval_string_wrap'
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/lib/ruby/1.8/apache/eruby-run.rb:116:in `run'
[Sun Sep 26 04:21:25 2010] [error] mod_ruby: from /usr/lib/ruby/1.8/apache/eruby-run.rb:72:in `handler'
I searched in google but there's not much to find. Does anyone has an
idea what exactly goes wrong here?