My very own guide to ruby on rails
Sign up at
Free Web Hosting, Free Domain Hosting, Free Web Hosting with No Ads, Post For Host - Home for a hosting package (they offer free hosting without ads, hosting with forced ads, paid hosting and post 2 host, so there is a solution for everyone).
Then sign up to their support and request ssh access, this can be done here:
Psychz Networks - Powered By Kayako eSupport
Your request should look like this:
Domain - ******.profusehost.net
Username - ******
Server - Profuse Host
Issue - I want to request ssh access for my account to start ruby on rails development. Regards *******
After you are given access, please follow the steps below.
=============================================
Connect to the server via ssh (psychz helpdesk provide all information required).
Connected successful, then type “cd public_html” press enter, to open the folder public_html. Inside the Folder type “rails -d mysql myProject” (for myProject choose your project name) to create a new project.
Next step set up a database
- open cpanel mysql database at
http://*****.profusehost.net:2082/fr...sql/index.html
- create a database named db (the database is going to be ******_db because profusehost forces you to use your username at the beginning). Then create a mysql user named db and flush all privileges to this user.
- Now after the database is created connect your ruby on rails application with the database, by editing config/database.yml. Delete all content inside and type:
development:
adapter: mysql
encoding: utf8
database: *****_db
username: *****_db
password: *********
socket: /tmp/mysql.sock
test:
development
production:
development
Now we want to create the hello world engine, type “./script/generate controller hello index” in your myProject directory. Then open the file /app/controllers/hello_controller.rb delete everything inside and type:
class HelloController < ApplicationController
def index
render :text => "Hello World!"
end
end
After the code is on the server, we have to change some factors to run it properly.
Open /config/enviroment.rb and change “# ENV['RAILS_ENV'] ||= 'production'” to “ENV['RAILS_ENV'] ||= 'production'” and open /public/.htaccess and change “RewriteRule ^(.*)$ dispatch.cgi [QSA,L]” to “RewriteRule ^(.*)$ dispatch.fcgi?$ [QSA,L]”
That is all you do not have to touch any further files.
Now run
http://*****.profusehost.net/myProjekt/public/hello/
And you should get “Hello World!” otherwise contact me for support.