I'm having problems deploying a rails application that contains engines.

When I had namespaced routes (Engine::Application.routes.draw) in
routes.rb, I was unable to get past the "no such file or directory" errors
from apache. The request never got back to the application.

When I used global routes (Rails.application.routes.draw) in routes.rb, I
can not direct the request to the namespaced controller. I get
"uninitialized constant" with the non-namespaced controller name.

The Getting Started with Engines<http://guides.rubyonrails.org/engines.html>Rails Guide does not include information on deploying an application
containing engines.

The relevant portion of the apache configuration is:
<Directory /var/www/html/links>
Options -MultiViews
RailsBaseURI /links
RailsEnv staging
PassengerRuby
/usr/local/rvm/rubies/ruby-1.9.3-p484/bin/ruby
</Directory>
/var/www/html/links is a symbolic link to the public directory of the
deployed application.

A solution to either problem (namespaced or non-namespaced) is acceptable.
A solution with namespaced routes is preferred.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8a819090-444e-4610-941f-f09503eaf737%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Jsnark at Jan 15, 2014 at 3:25 pm
    Problem solved.

    The namespaced paths generated by engine.path need to be modified by
    prefixing them with the applications base path. I use the apache
    RewriteRule for this:

    RewriteRule ^/engine/?(.*) /app/engine/$1 [R]

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2fbc3d1f-0232-40c0-bc97-0c5afc749fa4%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 14, '14 at 9:15p
activeJan 15, '14 at 3:25p
posts2
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Jsnark: 2 posts

People

Translate

site design / logo © 2022 Grokbase