Topic: Some help on how to run Rails apps? (Using Dreamhost)

Okay, I've never used RoR before. This is my first time, I want to use this svn browser (https://bssvnbrowser.bountysource.com/docs/install), and I did the component install.

I ran rails <name> and it created the dir, etc. then I installed the component install for that above. Opening up the app dir in my browser showed the Rails default page, and I was instructed to delete that index.html. So I did.

Now when I go to the app directory in my browser, I get this

---
Routing Error

Recognition failed for "/"
---

This is because there is no index file I'm guessing, so I really don't understand what I'm supposed to be doing now...

Last edited by nixnax (2006-07-15 00:26:06)

Re: Some help on how to run Rails apps? (Using Dreamhost)

In your config/routes.rb file you need to specify which controller you want the root ("/") of your website to go to. Look in the routes.rb file for a line which you can uncomment and customize to route the root to a controller.

Last edited by ryanb (2006-07-15 02:17:03)

Railscasts - Free Ruby on Rails Screencasts

Re: Some help on how to run Rails apps? (Using Dreamhost)

Okay.

I put this line in the routes.rb file:

  map.connect :controller => 'bs_svn_browser/browser', :action => "distributor"

And now it seems to loading that controller I guess, but now I'm getting this error:

---
Application error

Rails application failed to start properly
---

Re: Some help on how to run Rails apps? (Using Dreamhost)

Try this line instead in your routes.rb file:

map.connect '', :controller => 'bs_svn_browser/browser', :action => "distributor"

The first element should be an empty string when setting the root route.

If that doesn't work, it may be a permissions issue. Here are a few links that might help.

http://ocsforums.com/showthread.php?t=276
http://forum.textdrive.com/viewtopic.php?id=4037
http://6brand.com/articles/2006/04/09/a … t-properly
https://www.asmallorange.com/help/index … &nav=0

Railscasts - Free Ruby on Rails Screencasts

Re: Some help on how to run Rails apps? (Using Dreamhost)

Yeah, I've already tried using that line and it wasn't working so I guessed it wasn't needed. I put it back though (and it's still not working obviously).

I checked out all of those links, and tried everything. The 3rd link however, says to try setting permissions to the log and tmp dirs. But for some reason I get permission denied whenever trying to set those permissions.

chmod -R 0666 tmp
chmod -R 0666 log

Both give me permission denied, cannot access. I can chmod all the other dirs/files though but not those 2.

Could that be the reason I'm getting the application error? If so, is there anyway around this?

Re: Some help on how to run Rails apps? (Using Dreamhost)

The permissions problem could be what's hanging you up.  Try the following (more liberal) approach just to see if it works:

chmod -R 0777 tmp
chmod -R 0777 log

This makes those folders world-writable and readable but it's a good start.  If this solves (at least part of) your error then you can always try setting it back down to 0666 later.

If you want to post any other errors you're seeing please feel free.

Re: Some help on how to run Rails apps? (Using Dreamhost)

I wasn't able to set 0777 but I was able to set 777 permissions, which allowed me to atleast look at the logs now. Though I'm getting application error still.

In the development.log file, I'm getting this error:

Processing BrowserController#distributor (for 68.70.204.251 at 2006-07-16 17:15:59) [GET]
  Session ID: 88a5d9d7a5683c3ba7567ea39dbb15cf
  Parameters: {"action"=>"distributor", "controller"=>"bs_svn_browser/browser", "path"=>[]}
Rendering text<h1>SVN Error</h1> An SVN error has occured: uninitialized constant Svnlayoutfalse within /home/nixnnet/lollinks.net/svn/app/views/layouts/standard.rhtml

Re: Some help on how to run Rails apps? (Using Dreamhost)

That error looks application specific. Have you tried testing the application under development mode on your local machine? Do that to work out all the bugs before deploying it to Dreamhost. Just run "ruby script/server" in the command line at your rails app's root directory and open your browser to "http://localhost:3000" to access the site.

As for the error, ruby is trying to access a constant which hasn't been set (Svnlayoutfalse). Look for that constant in your app and make sure it is being set before being accessed.

Railscasts - Free Ruby on Rails Screencasts