I’ve setup a Redmine server for a project I’m working on here with the REST API enabled: http://zqwjs.se.rit.edu/redmine. However, when I went to test if the issues.xml file is showing up on my redmine server (http://zqwjs.se.rit.edu/redmine/issues.xml), I’ll end up getting a blank page. Does anyone have any suggestions on how I should fix my redmine configuration to allow me to call the REST API without errors?
Note: If I ran the following ruby code against my redmine server, I’ll get a 406 error back:
require 'rubygems'
require 'active_resource'
# Issue model on the client side
class Issue < ActiveResource::Base
self.site = 'http://zqwjs.se.rit.edu/redmine/'
end
# Retrieving issues
issues = Issue.find(:all)
print issues
Printout from console:
NOTE: Gem::Specification#default_executable= is deprecated with no replacement.
It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from C:/Ruby187/lib/ruby/gems/1.8/
specifications/rubygems-update-1.8.2.gemspec:11.
C:/Ruby187/lib/ruby/gems/1.8/gems/activeresource-3.0.9/lib/active_resource/conne
ction.rb:145:in `handle_response': Failed. Response code = 406. Response messa
ge = Not Acceptable. (ActiveResource::ClientError)
from C:/Ruby187/lib/ruby/gems/1.8/gems/activeresource-3.0.9/lib/active_r
esource/connection.rb:114:in `request'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activeresource-3.0.9/lib/active_r
esource/connection.rb:79:in `get'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activeresource-3.0.9/lib/active_r
esource/connection.rb:217:in `with_auth'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activeresource-3.0.9/lib/active_r
esource/connection.rb:79:in `get'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activeresource-3.0.9/lib/active_r
esource/base.rb:857:in `find_every'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activeresource-3.0.9/lib/active_r
esource/base.rb:777:in `find'
from redmine-interact.rb:10
I don’t have this problem with version 1.2.1. Your exact code works fine on my installation, so I assume that you are running an older version of Redmine that has not built in the Issues REST API yet.