ActionWebService and Rails 2.0 RC2

Hi,

I don’t really understand how action_web_service is configured for Rails
2.0 RC2.
Simply installing “gem install actionwebservice” as stated by DHH
doesn’t do the trick. When I do “require ‘action_web_service’” in the
environment.rb I get a dependency error:

/usr/lib/ruby/1.8/rubygems.rb:254:in `activate’: can’t activate
actionpack (= 1.13.6), already activated actionpack-1.99.1]
(Gem::Exception)

There are no generators or plugins available for ActionWebService as far
as I can see. So basically I’m stuck…

Does anybody know what to do?

Thanks, Bas

OK, I found a way to get ActionWebService working.

First do the following to install the actionwebservice (the gem does not
work right now because it depends on another rails version then 1.99.1):

rake rails:freeze:edge TAG=rel_2-0-0_RC2
svn export
http://dev.rubyonrails.org/svn/rails/ousted/actionwebservice/
vendor/rails/actionwebservice

Then add the following to the environments.rb file (from
http://fiatdev.com/2007/05/31/making-actionwebservice-work-with-edge-rails):

Rails::Initializer.run do |config|
# Add additional load paths for your own custom dirs
config.load_paths += %W(
#{RAILS_ROOT}/app/apis
#{RAILS_ROOT}/vendor/rails/actionwebservice/lib
)

# ...more stuff...

end

require ‘action_web_service’

You also need to add the following line to test_helper.rb:

require ‘action_web_service/test_invoke’

Now ActionWebService works again. The web_service_scaffold still does
not work however. I haven’t found a fix for this yet.

Hi

We’ve been having major stability problems running AWS on Rails 2.0
under production mode. It seems to throw random 404 errors after a few
requests, even on a simple test service. In addition to this we’ve
also found that direct dispatching no longer works. We did manage to
get the web service scaffold working by copying the template files
from AWS into the views directory as though you were overriding the
standard view. However, due to the production mode errors we’ve
switched back to 1.2.x for the time being.

If you’d like further details on the problems we experienced I made a
post a few days ago titled something like ActionWebService with Edge
Rails/Rails 2.0.

It would be really nice if someone on the core team familiar with AWS
could take a look at Rails 2 compatibility.

Anyway, I’d be interested in hearing if anyone else is experiencing
similar issues.

Regards,
Elliot

Using Rails 2.0.1, got AWS to work following your instructions without
the ‘require’ at the end of the enviro.rb

Also, scaffolding using default templates requires the following line
to be patched:

actionwebservice/lib/action_web_service/scaffolding.rb line 114
content = @template.render :file => default_template

TO

content = @template.render({:file => default_template, :use_full_path
=> false})

Hope this helps

is this possible yet to use aws without code freezing ?

On 24 Jan 2008, at 09:15, mariek wrote:

is this possible yet to use aws without code freezing ?

Don’t know what you mean by freezing, but I use AWS with rails 2.0
with no problems. I wrote up what I did at

Fred

On 24 Jan 2008, at 13:08, mariek wrote:

with rcov.

Sounds like a problem with rcov to me. Regardless, I don’t thing
anything I’ve done depends on having AWS installed in vendor. Having
got the source, you can easily build the gem yourself (the Rakefile
will do that, although it looks like you’ll need to change the version
of actionpack/activerecord it depends on).

Fred

Hi,
The same what You meant by writing : “(we have all of the rails gems
frozen there).”

Freezing causes a problem with rcov to me (can’t load plugin - no
such file to load – rcov/rcovtask) so I’m looking now for method to
also freeze third party gems and hope to see it working.

If I didn’t need to freeze for using AWS I wouldn’t have this problem
with rcov.

Marek

thanks for help, I managed without freezing , by just adding path to
environement

BTW, do You know any good tutorial on how to build from plugin source?

Sorry, I meant bulding gem from plugin, as You suggested :

Having got the source, you can easily build the gem yourself

One another question about AWS
Does 'web_service_scaffold :invocation ’ works for You ?
Im getting error :

ActionView::ActionViewError in BackendController#invocation
Couldn’t find template file for …vendor/gems/actionwebservice/lib/
action_web_service/templates/scaffolds/methods.erb in ["/app/views"]

On 25 Jan 2008, at 13:52, mariek wrote:

Couldn’t find template file for …vendor/gems/actionwebservice/lib/
action_web_service/templates/scaffolds/methods.erb in ["/app/views"]

I don’t use that, but i read the following here back in december:

On 25 Jan 2008, at 10:32, mariek wrote:

thanks for help, I managed without freezing , by just adding path to
environement

BTW, do You know any good tutorial on how to build from plugin source?
build what from plugin source (what plugin, what source?) ?

Fred

Frederick C. wrote:

On 25 Jan 2008, at 13:52, mariek wrote:

Couldn’t find template file for …vendor/gems/actionwebservice/lib/
action_web_service/templates/scaffolds/methods.erb in ["/app/views"]

I don’t use that, but i read the following here back in december:

Why don’t just use

gem install actionwebservice --ignore-dependencies

Bas Van westing wrote:

Hi,

I don’t really understand how action_web_service is configured for Rails
2.0 RC2.
Simply installing “gem install actionwebservice” as stated by DHH
doesn’t do the trick. When I do “require ‘action_web_service’” in the
environment.rb I get a dependency error:

/usr/lib/ruby/1.8/rubygems.rb:254:in `activate’: can’t activate
actionpack (= 1.13.6), already activated actionpack-1.99.1]
(Gem::Exception)

There are no generators or plugins available for ActionWebService as far
as I can see. So basically I’m stuck…

Does anybody know what to do?

Thanks, Bas

actionwebservice gem doesn’t seem to work with rails 2.2.2/ruby 1.8.6.
Is there any other alternative available with rails 2.2.2?

Thanks, Rashmi

Rashmi Pandit wrote:

Bas Van westing wrote:

Hi,

I don’t really understand how action_web_service is configured for Rails
2.0 RC2.
Simply installing “gem install actionwebservice” as stated by DHH
doesn’t do the trick. When I do “require ‘action_web_service’” in the
environment.rb I get a dependency error:

/usr/lib/ruby/1.8/rubygems.rb:254:in `activate’: can’t activate
actionpack (= 1.13.6), already activated actionpack-1.99.1]
(Gem::Exception)

There are no generators or plugins available for ActionWebService as far
as I can see. So basically I’m stuck…

Does anybody know what to do?

Thanks, Bas

actionwebservice gem doesn’t seem to work with rails 2.2.2/ruby 1.8.6.
Is there any other alternative available with rails 2.2.2?

Thanks, Rashmi

Yes,
I am also revolving around the exact same problem…
I am on ruby 1.8.6 with rails 2.2.2 and actionwebservice1.2.6 installed.
But I can’t generate web_service using the script generator, and inside
my app/apis directory in abc_api.rb class I am getting error on line
class AbcAPI < ActionWebService::API::Base

Any solutions…