Tuesday, February 8, 2011

How do I get a cPanel-created Ruby On Rails setup working properly? It's returning nothing for custom views.

Programmer Question

I've gone through the very helpful tutorial at railsforzombies.org and am now ready to get a test RoR install going. My site is on a shared host, using cPanel. I've created the test application using cPanel, and it's set up at ~/rails_apps/blog. I created a rewrite that redirects mydomain.com/testblog/ to mydomain.com:12002, which is the port that cPanel has my RoR app running on. I also started the application via cPanel, in development mode.



If I go to http://mydomain.com/testblog/, I see the helpful page that lets me know that my RoR app has been created and is functioning. Great, right? Well, not so fast.



I'm following along with the Getting Started guide at http://guides.rubyonrails.org/v2.3.8/getting_started.html, and I get to step 4. I've run



script/generate controller home index


and edited the resulting view at app/views/home/index.html.erb. It's just a simple



Hello rails!




However, when I go to mydomain.com/testblog/home/index (with or without the trailing '/'), I get a blank page in my browser, nothing at all (View Source shows nothing).



To make sure that I'm not going crazy, I put a text file in my rails app's /public directory, and when I go to mydomain.com/testblog/test.txt, it gets served properly. So I know that the Apache rewrite from cPanel is working properly.



Any ideas? I figure I'm overlooking something that's obvious, but I'm drawing a blank for now.



For reference, I'm running on cPanel 11, Ruby 1.8.7 and Rails 2.3.8. I would love to be running Rails 3.0, but the shared host says it's a no-go for now.



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails