문제

My Ruby on Rails 3.2 application uses the public directory in the projects directory. A normal situation. I would like to access a public directory in another server used by another Ruby on Rails 3.2 application since the files I want are the same.

So my app's public directory currently used: server_ip/opt/RoR/foo/public

Other app's public directory with files: server_ip/opt/RoR/foo/public

I know the files themselves are public, but my application needs to have normal permissions to sub-directories in the public directory.

Not sure if this helps but the application with the public directory I want to share uses Nginx. The application I want to give access to uses Apache2.

Any resources or ideas appreciated. Thank you

도움이 되었습니까?

해결책

If accessing files is your prime need then you can go with current working directory then go ahead with your required files.

 Dir.pwd.concat("/public/your_file_path")

Next, if your 2 apps running on same machine then they can be differentiated with 2 different ports.(3000 & 3001) want to access App(running on 3001) then make localh:30001/required_file_path.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top