![]() |
![]() |
|
|
|||||||
| Ruby Discussion of Ruby and all related code, and its usage and development, both on Site5 servers and elsewhere |
|
|
Thread Tools |
Rating: |
Display Modes |
|
#1
|
|||
|
|||
|
[HOW TO] Install a RubyOnRails app on a Site5 account
I don't know where to put this guide exactly so I'm starting here
Basically, I am assuming you're developing your RubyOnRails application on your computer first (and you access it with http://127.0.0.1:3000). Here are the steps to have a decent RoR app running with Site5 (without FastCGI unfortunately, we're still waiting to have it on all the servers). 1/ Open a SSH session and go at the root of your personal directory (place where you can see the directory public_html). 2/ Type Code:
rails name_of_your_application 3/ Using FTP, upload the following directories:
4/ Now let's create a symbolic link: Code:
cd ~ ln -s your_app/public/ public_html/your_app_another_name Note(2): The idea is to move away your application files from public users, especially the config files. That's the reason why we're creating the app at the root of the user home directory and creating a link to access only the public dir. 5/ We have to declare the symlinks by creating the .htaccess file: Code:
vi public_html/.htaccess Code:
Options +FollowSymLinks +ExecCGI RewriteEngine On Code:
chmod -R 755 your_app/* replace #!/usr/bin/ruby18 with #!/usr/bin/ruby At this stage you may want to test the installation by visiting the address: http://www.your_domain.com/your_other_app_name/ or http://www.your_domain.com:3000/your_other_app_name/ You should obtain the congratulations page of the server running perfectly well .8/ Once you're done testing this, we're gonna create a simple route to display a page as the index page (like an index.html or index.php page) First delete the index.html in the public dir unless you want to use it Code:
rm your_app/public/index.html Code:
vi your_app/config/routes.rb Code:
map.connect '', :controller => 'your_controller', :action => 'action_to_be_seen_as_index' Code:
vi your_app/config/environment.rb Code:
ENV['RAILS_ENV'] = "production" RAILS_ENV = ENV['RAILS_ENV'] Now, you should be allright and ready to show your work to the rest of the world ! You will be able to access the index page by typing: http://www.your_domain.com/your_another_app_name/ Fortunately, you won't experience issues. I may forget some parts or putting some steps that are not exactly in accordance with your system configuration. Please forgive me if I made some mistakes, I'm no "RubyOnRails guru" ![]() I'm ready to hear comments, suggestions or troubles ! Cheers, Dominique. Last edited by dom974; September 2nd, 2005 at 05:49 PM. |
|
#2
|
|||
|
|||
|
Dominique, great info. Thanks!
I've stuck this thread and moved it to the Ruby Forum.
__________________
-Steven Site5 Forum Overseer Want the answers to the universe and everything? Check out the Site5 Wiki! "To err is human, to forgive divine." |
|
#3
|
|||
|
|||
|
My pleasure Steven ! Thanks moving the thread, I didn't notice the ruby forum at first
|
|
#4
|
||||
|
||||
|
Edit: Nevermind... *sigh* the problem occured because I was trying to create a symlink to a directory that already existed. Like I said, stupid user error... maybe my mistake will help someone else, though.
![]() Thanks for posting this. I'm having a problem, though. I'm sure it's stupid user error on my part. I can't get my symlink to work.I've set up the rails app directory as "AddressBook" inside my home directory, and I'm trying to point it to public_html/dev using the following: Code:
ln -s AddressBook/public/ public_html/dev As you can see, though.... It's not working: http://www.kellishaver.com/dev/ Any ideas? Last edited by KelliShaver; September 7th, 2005 at 11:50 PM. |
|
#5
|
|||
|
|||
|
I got my symlink working after I used full paths from root.
Now I have other problem: Pages display fine except none of the images show up. The images are in public/images -folder. Any idea what might cause this? -- edit Well.. I figured it out. The images paths are now wrong. /images/logo.jpg should be /(symlink name)/images/logo.jpg Isn't there easier way to deal with this than to rewrite all the image paths? -- edit #2 Ok. I solved that too by following the instructions here: http://wiki.rubyonrails.com/rails/sh...InstallOnSite5 So I renamed public_html to public_html_back and created a symlink public_html. Last edited by Heikki; September 8th, 2005 at 04:17 AM. |
|
#6
|
||||
|
||||
|
I have never coded in my entire life. What is this about? How do I get ssh? O.o
|
|
#7
|
|||
|
|||
|
Quote:
). For windows, PuTTY is a great SSH client.
__________________
David Felstead |
|
#8
|
||||
|
||||
|
Quote:
|
|
#9
|
|||
|
|||
|
That's the name of the site5 server your site is hosted on - stacia, hypnos, leto, etc... You should be able to ssh to username@yourdomain.com as well - you'll see the name of the box in the welcome message there.
Hope that helps!
__________________
David Felstead |
|
#10
|
|||
|
|||
|
taking the first steps to install an RoR app on site5. after entering "rails appname" at the command line, i'm getting the following error message:
Quote:
|
|
#11
|
|||
|
|||
|
I believe you'll have to contact Customer Service to get that fixed as that lib doesn't seem to be installed.
__________________
-Steven Site5 Forum Overseer Want the answers to the universe and everything? Check out the Site5 Wiki! "To err is human, to forgive divine." |
|
#12
|
|||
|
|||
|
A lot of people seem to be having problems installing Rails apps via the symlink method since they stripped down environment.rb and created the Initializer class in version 0.14.whatever. If you KNOW for a fact that you've done everything else right and are still getting "Premature end of script headers" errors in your logs and generic 500 error pages when you try to load your app, an additional step is necessary when you lack the administrative access necessary to add the relevant Alias directive to your httpd.conf file. I have not seen this documented anywhere, but a quick skim of the code in initializer.rb shows what the problem is.
boot.rb determines the root directory of the application with one line of code: Code:
root_path = File.join(File.dirname(__FILE__), '..') Code:
RAILS_ROOT = '/home/mydomaincom/myrailsapp/' Code:
ENV['RAILS_ENV'] = 'production' EDIT: Or you can alternatively pass true to Pathname#cleanpath on line 5 of boot.rb so it reads Code:
root_path = Pathname.new(root_path).cleanpath(true).to_s Last edited by orangekay; November 20th, 2005 at 09:19 AM. |
|
#13
|
|||
|
|||
|
Has anyone successfully installed Instiki on Site5? A brief tutorial would be very, very helpful. Thanks!
Last edited by bbebop; November 21st, 2005 at 08:04 PM. |
|
#14
|
|||
|
|||
|
To clarify the symbolic link problem, here's what instruction line #4 should say:
cd ~ ln -s /home/your_username/your_app/public/ public_html/your_app_another_name Otherwise the sym link doesn't have enough information. |
|
#15
|
|||
|
|||
|
Does anyone know how to set this up with Subversion? I want to be able to make the repository in a directory like /home/user_name/svn and have it symlink to /home/user_name/public_html/svn .
|
|
#16
|
|||
|
|||
|
Quote:
ln -s ~/public_html/svn ~/svn
__________________
-Steven Site5 Forum Overseer Want the answers to the universe and everything? Check out the Site5 Wiki! "To err is human, to forgive divine." |
|
#17
|
|||
|
|||
|
Nope, and anyway that defeats the purpose of symlinking.. that would expose parts of the repository I don't want to expose. Even if it did work, it would not be a practical solution.
I'm actually have a pending support ticket about this with the reseller staff, we've been back and forth about the issue but can't come up with a solution.. This would be a BIG thing if we could get it working.. even bigger if it's possible with my resold accounts. |
|
#18
|
|||
|
|||
|
I've decided not to use subversion
o well...In other news, Line #4 should be modified in the post so that when people are actually following the directions, they don't have to scroll down the post to find out why the symlink didn't work.
__________________
Ann Arbor Website Design |
|
#19
|
|||
|
|||
|
Well, everything worked fine until I followed the steps after #7. Now I get the notorious
Application error Rails application failed to start properly" error http://www.desire2design.com/ca/
__________________
Ann Arbor Website Design |
|
#20
|
|||
|
|||
|
While installing Mailr, I followed this post, and I found that
1 symlink is ok, and need no absolute dir, just ln -s ~/railsapp/public public_html/railsapp is ok. 2 if rails app need be accessed as http://site.com/railsapp/, add RAILS_ROOT = '/home/mydomaincom/myrailsapp/' to environment.rb works. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| automated remote backup of my PC's to my site5 account? | gregconquest | Old Discussions | 2 | April 1st, 2005 09:55 PM |