Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8302049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:11:23+00:00 2026-06-08T17:11:23+00:00

I have an JRuby on Rails 3.1.6 application and want to deploy it on

  • 0

I have an JRuby on Rails 3.1.6 application and want to deploy it on a Tomcat 7 as WAR file. To generate the war I use warbler.

I can deploy the application to the server and all is running. But the links generated or a redirect form devise to /users/sign_in dont work because the context path is ignored.

I tried to set the relative url root with:

config.action_controller.relative_url_root = '/foo'

But the method was not found. (Also tried the ENV variable for this, but nothing happened)

I tried to use scope '/foo' in my routes.rb but this doesn’t work either.

I also tried to add this in my config.ru

map '/foo' do
  run Foo::Application
end 

But the config.ru files seams not to be included in the WAR file or used in any way.

I can’t generate a VirtualHost or anything in tomcat, I have only the rights to deploy the application as WAR file. Is there any way to tell the rails application that it runs under a given subdirectory (context path) so it adds this to all generated links, redirects, etc., that works within Rails 3.1.6?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:11:24+00:00Added an answer on June 8, 2026 at 5:11 pm

    Sounds like a Devise thing, have you checked how it’s issuing the redirect ?
    It should have worked, assuming you do something like the following from an action :

    def index
      redirect_to :action => "hello"
    end
    

    jruby-rack (gets included when you warble) correctly handles cases when an application is running within a servlet context path different than /. I suggest to reverse the “hacks” you did trying to make things work and look into the code that redirected you … e.g. code such as redirect_to "/home/goodbye" won’t “work” (prefix the context path) as its assumed to be a complete URL path.

    As for the config.ru for a Rails application Warbler does not copy it – thus it can distinguish a Rails from a plain Rack application (as jruby-rack does more hooks into Rails to provide a seamless experience with servlet containers such as Tomcat).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java application, and I want to use rails migrations for this.
We're running a small web application written JRuby on Rails running under Tomcat. We're
We're convincing our Products officer that we want to use JRuby on Rails, and
I have a Web application using Jruby and Sinatra (App Engine) and I want
Anyone have any success with a JRuby on Rails war deployment and calendar_date_select? The
I'm deploying my Rails 3 application to a Tomcat 6 server. I've been using
I have the following code in my seeds.rb file in a jruby 1.6.3 rails
I have a JRuby on Rails application using a lot of Ajax GET calls.
We have a Rails application built with JRuby, and deployed to JBoss as a
I have Rails app set up using Jruby with puma as the web server.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.