Run rails app under subfolder

蹲街弑〆低调 提交于 2019-12-20 02:58:06

问题


I've been testing my rails app on localhost:3000 and it works just fine. However, when deploying to my host, the root URL is:

http://99.88.77.66/~username

I do not have a domain name at this point.

When I point the browser to the above URL I get the root not found for:

/~username

Alternatively for

http://99.88.77.66/~username/controller/index

I get this route not found:

/~username/controller/index

I'm using Rials 4.2.3 and Ruby 2.0.

How can I make my routes work with this kind of subfolder until I can get an appropriate domain name?


回答1:


Try setting config.relative_url_root in config/environments/production.rb:

http://guides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root



来源:https://stackoverflow.com/questions/31883197/run-rails-app-under-subfolder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!