jruby/jruby-rack — Issue #99: Wrong public_path in Rails 3.2
Author: zaadjis
Created: 2012-02-24 15:57:36+00:00
State: open

jruby-jars (1.6.7)
jruby-rack (1.1.4)
rails (3.2.1)
warbler (1.3.2)

Generating a new rails app with `rails new jruby-rack-bug -OJT` and adding this to `config/application.rb`:

$stderr.puts(Rails.public_path.inspect)
$stderr.puts((::PUBLIC_ROOT rescue :undefined).inspect)

yields this in the log:

130 [main] INFO org.mortbay.log - jetty-6.1.24
160 [main] INFO org.mortbay.log - Deploy /etc/jetty/contexts/javadoc.xml -> org.mortbay.jetty.handler.ContextHandler@285876fe{/javadoc,file:/usr/share/jetty/javadoc}
197 [main] INFO org.mortbay.log - Extract file:/var/lib/jetty/webapps/jruby-rack-bug.war to /var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp
1088 [main] INFO org.mortbay.log - NO JSP Support for /jruby-rack-bug, did not find org.apache.jasper.servlet.JspServlet
1189 [main] INFO /jruby-rack-bug - Warning: no max runtimes specified.
1247 [main] INFO /jruby-rack-bug - jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (OpenJDK 64-Bit Server VM 1.7.0_147-icedtea) [linux-amd64-java]
1247 [main] INFO /jruby-rack-bug - Info: using runtime pool timeout of 30 seconds
1247 [main] INFO /jruby-rack-bug - Warning: no min runtimes specified.
1247 [main] INFO /jruby-rack-bug - Warning: no max runtimes specified.
1259 [main] INFO org.mortbay.log - Opened /var/log/jetty/2012_02_24.request.log
1272 [main] INFO org.mortbay.log - Started SelectChannelConnector@:8080
"/var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp/WEB-INF/public"
"/var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp"
"/var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp/WEB-INF/public"
"/var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp"

$ file /var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp/WEB-INF/public
/var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp/WEB-INF/public: ERROR: cannot open `/var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp/WEB-INF/public' (No such file or directory)
$ file /var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp
/var/cache/jetty/data/Jetty__8080_jruby.rack.bug.war__jruby.rack.bug__7r60zq/webapp: directory