ActionWebService and Rails 2.0 RC2

8 views
Skip to first unread message

Bas Van westing

unread,
Nov 29, 2007, 4:29:51 PM11/29/07
to rubyonra...@googlegroups.com
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
--
Posted via http://www.ruby-forum.com/.

Bas Van westing

unread,
Dec 1, 2007, 8:37:07 AM12/1/07
to rubyonra...@googlegroups.com
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.

Elliot Bowes

unread,
Dec 1, 2007, 10:40:32 AM12/1/07
to rubyonra...@googlegroups.com
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

provokeme

unread,
Dec 17, 2007, 1:27:04 AM12/17/07
to Ruby on Rails: Talk
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

On Dec 1, 8:40 am, "Elliot Bowes" <ebli...@gmail.com> wrote:
> 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
>
> On 01/12/2007, Bas Van westing <rails-mailing-l...@andreas-s.net> wrote:
>
>
>
> > 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-...

mariek

unread,
Jan 24, 2008, 4:15:10 AM1/24/08
to Ruby on Rails: Talk
is this possible yet to use aws without code freezing ?

Frederick Cheung

unread,
Jan 24, 2008, 5:21:20 AM1/24/08
to rubyonra...@googlegroups.com

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 http://www.texperts.com/2007/12/21/using-action-web-service-with-rails-20/

Fred
>
> >

mariek

unread,
Jan 24, 2008, 8:08:42 AM1/24/08
to Ruby on Rails: Talk
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

Frederick Cheung

unread,
Jan 24, 2008, 8:24:38 AM1/24/08
to rubyonra...@googlegroups.com

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

> Marek
> >

mariek

unread,
Jan 25, 2008, 5:32:12 AM1/25/08
to Ruby on Rails: Talk
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?

Frederick Cheung

unread,
Jan 25, 2008, 7:00:21 AM1/25/08
to rubyonra...@googlegroups.com

build what from plugin source (what plugin, what source?) ?

Fred

>
> >

mariek

unread,
Jan 25, 2008, 8:52:24 AM1/25/08
to Ruby on Rails: Talk
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"]

Frederick Cheung

unread,
Jan 25, 2008, 11:43:45 AM1/25/08
to rubyonra...@googlegroups.com

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

Jirapong Nanta

unread,
Sep 4, 2008, 6:02:52 AM9/4/08
to rubyonra...@googlegroups.com
Frederick Cheung 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

Rashmi Pandit

unread,
Apr 1, 2009, 7:39:36 AM4/1/09
to rubyonra...@googlegroups.com

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

Reply all
Reply to author
Forward
0 new messages