SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem getting RoR functioning on Linux server.

    I'm trying to do a little tutorial on creating a RoR app and i think I'm
    having trouble with actually booting the server correctly. I've
    installed Rails on my Linux server and am able to do the various
    commands to get things going (such as "ruby blog" and generating
    controllers). But when I tried to create an index action and check it out
    on the web i got this:

    Application error

    Rails application failed to start properly"

    When I start the server in SSH I get "Rails application started on
    http://0.0.0.0:3000"...which obviously isn't right...but what/where do I
    need to change?

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Location
    Murcia, Spain
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a problem with where you're trying to access rails, where you've installed it or the server paths and links in between. Rails automatically boots the webrick server on yourdomain.com port 3000.

    It looks like it you've got it working just fine to me. Click on this and I think you'll agree :

    http://www.sabotagemedia.com:3000/

  3. #3
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by matthewmurcia
    This is a problem with where you're trying to access rails, where you've installed it or the server paths and links in between. Rails automatically boots the webrick server on yourdomain.com port 3000.

    It looks like it you've got it working just fine to me. Click on this and I think you'll agree :

    http://www.sabotagemedia.com:3000/
    Ah okay. Hmm...so if I was developing some sort of website with RoR...how could I access the site/URL without the port attached?

  4. #4
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And also, it seems that any controllers I create are un-editable after they are created. In other words, I can't edit blog_controller.rb in Dreamweaver and upload it because it says permission denied...is there anyway to fix this?

  5. #5
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Location
    Murcia, Spain
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as the site path goes, I couldn't really answer that at the minute. I'm currently at the stage of putting together a VPS for rails and working those things out but from what I've read so far you configure the port in the server configuration file, not rails. Then, at least as far as I've got with lighttpd, you can't do site.com/railsapp1, site.com/railsapp2 etc.. but have to do it with subdirectories like railsapp1.site.com, railsapp2.site.com. It will apparently possible to do it the other way with lighttpd 1.4.8, which is the next release. I don't know iwth Apache.

    Don't really know about file permissions. I've read in a few places that dreamweaver does this sometimes when it uploads some files but don't know if that is what is would be happening in this case. Sorry.

  6. #6
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RockNRollPig
    And also, it seems that any controllers I create are un-editable after they are created. In other words, I can't edit blog_controller.rb in Dreamweaver and upload it because it says permission denied...is there anyway to fix this?
    Why are you uploading? You should be developing locally, and the built in Webrick server is for development only, its not a production-level server. Work on your own machine, mosts hosts will not be happy if you are running Rails in development mode on their server as it uses too many resources and you could be running potentially dangerous code.

    The most common way of serving a Rails site in production is using the Lighttpd server (www.lighttpd.net) and as many hosts who offer this tend to also offer Apache as default (on port 80), to access your site without adding the lighttpd port on the end, Apache is configured to proxy locally to the lighttpd server.

  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Location
    Murcia, Spain
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've discovered the answer to your first question today. To bind your rails apps to port 80 you have to get into your server's config file and change the port setting. In lighttpd it looks like this:

    server.port = 80

    You then need to start the server up with root priveleges as the port number is below 1024.

    I imagine apache has something similar.

  8. #8
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy

    Quote Originally Posted by Luke Redpath
    Why are you uploading? You should be developing locally, and the built in Webrick server is for development only, its not a production-level server. Work on your own machine, mosts hosts will not be happy if you are running Rails in development mode on their server as it uses too many resources and you could be running potentially dangerous code.
    Ok, i'm a newbie, going through a bunch of tutorials before working on my web site and this post makes me confused.

    I'm doing tutorials and other trials on my windows laptop but I thought i should develop my real site on my linux dedicated server.

    It seemed like all explanations in books assume you are developing the application on the actual server, especially in light of the development/test/production paradigm.

    Someone please enlighten me.

  9. #9
    Mal Reynolds Mandibal's Avatar
    Join Date
    Aug 2003
    Location
    Columbus
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by alles_klar
    Ok, i'm a newbie, going through a bunch of tutorials before working on my web site and this post makes me confused.

    I'm doing tutorials and other trials on my windows laptop but I thought i should develop my real site on my linux dedicated server.

    It seemed like all explanations in books assume you are developing the application on the actual server, especially in light of the development/test/production paradigm.

    Someone please enlighten me.
    I don't know that any tutorial or books assume you're developing on a live server. I would argue that now adays they assume you are not because its good practice to use a development computer.

    The development/test/production paradigm assumes you are using different environments but this doesn't have to mean physical machines. That being said it is a good idea to do development/testing on a local machine like your windows laptop. To make it easy, RoR has webrick to make it easy to start seeing results of development immediately. This doesn't prevent you from setting up a WAMP(RoR) environment on your laptop to develop the site using apache as the server. It is much more convienant to yourself to use a local machine for development so your not chewing up bandwidth and processor time on your live server. Plus the responses should be quicker and you don't have to work through FTP/SSH to edit/upload files constantly. Much more convienant. I prefer to set up a similar server setup to my live web hosting on my development machine. Helps cut down on any possible configuration changes that might be needed, although RoR makes this pretty easy as well.

    The testing part is used for both development with TDD and for deployment to ensure that the site functions properly before going live. Usually you'd want a test environment on the live server to run the tests first before copying the site over the live version.
    Erh

  10. #10
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up thanks

    Thank you Mandibal.

    That was clear and informative. I'll follow your advice.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •