|
#1
|
||||
|
||||
|
Ruby On Rails Support Dear Clients, We are happy to announce that Hostgator servers now support Ruby on Rails. This applies for all shared and reseller servers. The following is a brief overview on how you can use RoR with our servers. Update Version Report: Ruby Version : ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux] Gem Version : 1.0.1 Rails Version : Rails 2.0.2 Our CTO, David Collins and myself have selected the following Gems to be preinstalled with the Ruby installations. Custom gems are avaliable on a per request basis. If you need an additional gem installed, please create a support ticket. actionmailer Service layer for easy email delivery and testing. actionpack Web-flow and rendering framework putting the VC in MVC. actionwebservice Web service support for Action Pack. activerecord Implements the ActiveRecord pattern for ORM. activesupport Support and utility classes used by the Rails framework. BlueCloth BlueCloth is a Ruby implementation of Markdown, a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML). builder Builders for MarkUp. daemons A toolkit to create and control daemons in different ways feedtools Parsing, generation, and caching system for xml news feeds. gem_plugin A plugin system based only on rubygems that uses dependencies only gnuplot Utility library to aid in interacting with gnuplot htmltools This is a Ruby library for building trees representing HTML structure. mongrel A small fast HTTP library and server that runs Rails, Camping, and Nitro apps. mysql MySQL/Ruby provides the same functions for Ruby programs that the MySQL C API provides for C programs. payment Payment is used to process credit cards and electronic cash through merchant accounts. rails Web-application framework with template engine, control-flow layer, and ORM. rake Ruby based make-like utility. sources This package provides download sources for remote gem installation tidy Ruby interface to HTML Tidy Library Project uuidtools Generation of UUIDs. xml-simple A very simple API for XML processing. We are offering jailed SSH access on all our servers now. You can get SSH enabled for your account if you want to deploy and test Rails applications rapidly. The procedure to get SSH access is simple. You just need to email support@hostgator.com with your account information and a scanned copy of any photo identification document you have for authentication. We will enable jailed SSH access for you on proper verification of the account information. Following are the steps you can perform to deploy a demo Rail app and test its working on your account. 1. Login to your SSH using your own account. 2. Once logged in make sure you are in your /home/username folder using the “pwd” command. It should show the output like this : Code:
cpaneluser@server [~]# pwd
/home/cpaneluser
Code:
cpaneluser@server [~]# rails /home/cpaneluser/demoapp
cpaneluser@server [~]# cd demoapp
cpaneluser@server [~]# ruby script/generate controller test
Code:
cpaneluser@server [~]# cd ../public_html
cpaneluser@server [~]# ln –s ../demoapp/public rails
Code:
cpaneluser@server [~]# cd ../demoapp/public
cpaneluser@server [~]# pico .htaccess
Code:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] Code:
RewriteRule ^(.*)$ dispatch.cgi [QSA,L] You can then visit http://yourdomain.com/rails/ and you should see a “Welcome Aboard” page which confirms successful working of your rail app. You can deploy any other standard Rail applications as well. Most of them should work well with the preinstalled Gems we have. We have also enabled subversion (SVN) support on all of our servers which would facilitate fetching and installation of ruby scripts. If you have any questions/issues, please email support@hostgator.com.
__________________
Shashank Wagh Systems Administrator & Level III Support, Hostgator.com LLC. Find us @ http://www.HostGator.com/help/ Last edited by GatorJess; 06-10-2008 at 11:01 AM. Reason: Updated versions for viewers of the post; former versions listed were ruby 1.8.5 and rails 1.1.6 |
|
#2
|
|||
|
|||
|
Any tips for getting a rails application running on hostgator that was developed locally.
So I have a ruby on rails application on my local computer and want to upload it and host it on hostgator. I was able to successfully creat a rails application from the jailshell access. But i'm having issues getting a locally developed app running. I can get it to show the "welcome aboard" page. When I try to navigate to any pages or controller/views I get an error that "the page isnt redirecting properly" the log/development.log file file shows 302 messages showing the address in my address bar so it is loading as a static html page from what i see. |
|
#3
|
||||
|
||||
|
Thank you, thank you, thank you-- and if I didn't say it enough-- thank you!
And again for that, THANK YOU!
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#4
|
||||
|
||||
|
Ruby is ok, I'm not really a fan, but I did notice that you are offering Jailed shell as well!!! That is totally cool!
Finally, HostGator has come up with something totally cool! |
|
#5
|
||||
|
||||
|
Rails has cut the production time (and hence budget) on some of my recent projects by 50-75%. It's really something you should check out more in depth if you haven't.
And svn hosting is great as well.
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#6
|
|||
|
|||
|
hello,
I may like to know if you also propose some FastCGI support or even better some mongrel/lighttpd one ? This aside, a BIG thank you for this initiative. -- Sébastien Grosjean - ZenCocoon |
|
#7
|
||||
|
||||
|
Quote:
Quote:
Gratz HG ! Vtrain
__________________
Vtrain is Linux User #237333 on http://counter.li.org/ "Don't meddle in the affairs of sysadmins, for they are subtle and quick to anger." Last edited by vtrain; 01-12-2007 at 05:57 AM. |
|
#8
|
||||
|
||||
|
Cool.. like what?
|
|
#9
|
||||
|
||||
|
If I were you I'd go to the rails site and read up about some things people are doing. Sites I've done recently that tend to involve a LOT of database work and dynamic content tend to benefit the most.
http://rubyonrails.org/ -Matt
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#10
|
|||
|
|||
|
I guess I have been around too long. I see Ruby as a major step backward in terms of software development.
Come on this is the twenty first century and people are still using command line args, make utilities, relational databases, etc. ? As far as productivity goes, a lot of that is because they let a database schema drive automated access code generation. Now there's a feature that was really cool about twenty years ago. The more things change the more they stay the same... |
|
#11
|
|||
|
|||
|
Thanks for this!!!!
I was about to leave because you didn't support this. I am switching all me development to RoR and it has saved me tons-o-time. Thanks! ps:I thought fastcgi was the way to go with rails? Last edited by PsionBlue; 01-13-2007 at 03:45 PM. |
|
#12
|
||||
|
||||
|
Like upgrading any script using the patch approach (just one of many examples).
Code:
patch -cl -d [DIRECTORY] -p1 < [PATCH NAME] So I do thing that shell access can turn heavy tasks and very simples tasks. Vtrain
__________________
Vtrain is Linux User #237333 on http://counter.li.org/ "Don't meddle in the affairs of sysadmins, for they are subtle and quick to anger." |
|
#13
|
|||
|
|||
|
Is it just me or are no ruby on rails applications working? I had some applications running fine with symbolic links but now they are all 404 errors.
I tried creating a new rails app(just like the one in the first post) to test and it didnt work either. ![]()
|
|
#14
|
||||
|
||||
|
I have the welcome page up and running but haven't tested anything besides that yet.
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#15
|
|||
|
|||
|
Does anyone know how to just run ruby? I tried .rhtml, didn't work?
|
|
#16
|
|||
|
|||
|
The default extention for ruby is .rb
The .rhtml is an extention for Ruby included in HTML. If you like to use .rhtml without rails here is the procedure : First you want to ssh into the root dir that you want to server .rhtml files from and create a .htaccess with the following contents: RewriteEngine Off Options +FollowSymLinks +ExecCGI AddHandler rubypage .rhtml Action rubypage /cgi-bin/erb.cgi DirectoryIndex index.rhtml index.html index.htm next.. mkdir cgi-bin vim cgi-bin/erb.cgi and here’s what goes in erb.cgi: #!/usr/local/bin/ruby require 'time' require 'erb' include ERB::Util time = Time.now.httpdate HEADERS = <<-EOF Date: #{ time } Server: #{ ENV['SERVER_SOFTWARE'] } Last-Modified: #{ time } Content-Type: text/html EOF begin path = nil if (ENV['PATH_TRANSLATED']) path = ENV['PATH_TRANSLATED'] else file_path = ENV['REDIRECT_URL'].include?(File.basename(__FILE__)) ? ENV['SCRIPT_URL'] : ENV['REDIRECT_URL'] path = File.expand_path(ENV['DOCUMENT_ROOT'] + '/' + file_path) raise "Attempt to access invalid path: #{path}" unless path.index(ENV['DOCUMENT_ROOT']) == 0 end erb = File.open(path) { |f| ERB.new(f.read) } print HEADERS + erb.result(binding) rescue Exception print "Content-Type: text/html\n\n" # what the customer sees print "<h1>Page Not Found</h1>" # modify message variables ENV['SERVER_ADMIN'] = "admin@yourdomain.com" # email message MESSAGE = " From: Erb <admin@yourdomain.com> To: You <you@yourdomain.com> Subject: Error on YourDomain.com ****Script Error**** #{ $! } ****Backtrace**** #{$!.backtrace.join("\n")} ****Environment**** #{ENV.keys.map { |key| key + ' = ' + ENV[key] + "\n"} }" # send the message require "net/smtp" Net::SMTP.start('localhost', 25, 'yourdomain.com', 'admin+yourdomain.com', 'yourPassword', :login) do |smtp| smtp.send_message MESSAGE, 'admin@yourdomain.com', 'you@yourdomain.com' end end Make sure that the permissions on erb.cgi are 755 or it will not work. Not only does this script serve up your .rhtml pages, but it will notify you if there is a problem. If you want to use a .rhtml page for your 404 errors just add one more line to your .htaccess file: ErrorDocument 404 /404.rhtml Hope this help ;-) |
|
#17
|
|||
|
|||
|
I really appriciate your help- I saw this on some documentation somewhere, did you actually applicate this? I trust you did, but wanted to ask.
Yeah, I just want to learn ruby for a few days, once I wrap my mind around it-- check out rails....
|
|
#18
|
|||
|
|||
|
I didn't use this code as I didn't need it but I took it from the documentation of my RubyOnRails Hosting company, I'm not sure it will be really appreciate to name it right here.
Anyway, I trust this code but as usual when you reuse some code like that you got to understand by yourself how safe it is and if it really feet your need. On my idea you can directly go to Rails and you will learn Ruby in same time. I did that on my side and think that worked pretty well ;-) Cheers |
|
#19
|
|||
|
|||
|
Any plans to upgrade to Rails 1.2.1 shortly? I still have to finish my first Rails app and would prefer to target 1.2.1 directly.
Last edited by harald.walker; 02-04-2007 at 11:13 AM. |
|
#20
|
|||
|
|||
|
No problem, even if they don't update the rails gem you can still use rails 1.2.1 for your application by freezing rails.
To do it use the following rake task: rake rails:freeze:edge # Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0) You can find more about rake tasks on http://www.rubyonrailsblog.com/artic...asks-reference Hope this help ;-) -- Sébastien Grosjean - ZenCocoon http://www.zencocoon.com -- My company website http://seb.box.re -- Personal blog mainly based on rails thoughts http://www.villasthalassa.com -- Wonderful sea side villas to rent in Greece http://www.lefkadagreece.eu -- Find the land of your dreams, on a Greek island |
|
#21
|
||||
|
||||
|
I'm having a problem using this system.
I have set it up and I created a controller called items in a directory called menu. Then I create a symbolic link in /public_html/ called menu. When I browse it at home, it works fine in Windows. I can use it at 127.0.0.1:3000/menu When I use it on the web, I go to domain.com/menu, I see the welcome screen. But when I try to access items, it gets an error. I see the items controller under /app/controllers, but how do I access it? /menu/items doesn't work... Where am I going wrong? |
|
#22
|
|||
|
|||
|
I guess it may come from the dispatch.cgi file that is not the correct one.
To fix this issue, go in your menu folder (where is located your application) and run Code:
rails . Once this done, check that your public/.htaccess file (from your application) is properly made, as sayed at the top of this thread. I think you will also have to include the following lines in your ~/public_html/.htaccess file Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/your-subdomain$
RewriteRule .* http://you-subdomain.your-domain.your-domain-extention [R=301,L]
Anyway I don't see any risk in this particular code. Let us know if that worked for you ;-) Hope this help,
__________________
Sébastien Grosjean - ZenCocoon - www.zencocoon.com http://www.villasthalassa.com -- Wonderful sea side villas to rent in Greece http://www.lefkadalands.com -- Find the land of your dreams, on a Greek island http://www.catamaranforent.com -- Rent an amazing 42 feet catamaran in Ionian islands, Greece http://www.tiarehq.com -- Multilingual website builder, online publishing in minutes Last edited by ZenCocoon; 02-09-2007 at 04:56 PM. |
|
#23
|
|||
|
|||
|
Quote:
Do i need to edit the .htaccess? Do i need to use svn? (which i cant atm) |
|
#24
|
|||
|
|||
|
Ok, this may be obvious to the Unix veterans out there, but I struggled with it, so I thought maybe someone could find this useful.
Excuse my lousy English, I'm a non-native speaker. How to get Ruby on Rails running at the root of the domain Ok so GatorShashank's post tells you how to run a Ruby on Rails app in a subdirectory of your doman, i.e. www.mydomain.com/myapp. But what if you want to run it at the "root", www.mydomain.com? Puzzled? Well fortunately you have your Czecho friendo here to help you. First, follow everything on GatorShashank's post so that your app is running in a subdirectory, let's say www.mydomain.com/myapp/. You may find out that you actually don't need to do the last step (rewriting .fcgi to .cgi), because somehow it is automagically done for you (at least for me it was). Also note that when you're done, navigating to www.mydomain.com/myapp still might throw an 400 Error: Bad Request. Why? Because you're trying to navigate to a file. What you want is to navigate to a directory. Solution: go to www.mydomain.com/myapp/ instead (note the trailing slash). Now that we have our app running, we need to tell the Apache server to run it when the user navigates to www.mydomain.com. Obvious? No. Easy? Yes! Create (or edit if it already exists) a ".htaccess" file in your /public_html/ directory. Now insert the following four [update]five[/update] lines: Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/cpanel/.*
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com [OR]
RewriteCond %{HTTP_HOST} ^mydomain\.com
RewriteRule ^(.*)$ /myapp/$1 [L,QSA]
-- Filip, reklama.visible.cz Last edited by filiph; 03-05-2007 at 02:42 AM. |
|
#25
|
|||
|
|||
|
Thanks filiph,
i must admit i started RoR 1 months ago and with my Classic ASP and Win hosting knowledge all this new stuff is....overwelming. My problem seems to be that i cant get my controllers running even in the domain/myapp/. i can browse the index page but not the controller. If i check via console the application starting ruby script/console from the folder /<user>/home/appFolder i can access controllers and models but not from the www.mydomain.com/railsApp where railsApp is the name in ln command. Thanks again. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|