sudo apt-get install ruby rails sqlite3 libsqlite3-rails
Then I ran the following commands:
mkdir RubyOnRailsApps
cd RubyOnRailsApps
rails FirstApp
cd FirstApp/
./script/generate controller Say
vi app/controllers/say_controller.rb
And make the file look like:
class SayController < ApplicationController
def hello
end
end
vi app/views/say/hello.rhtml
And make the file look like:
<html> <head> <title> First Ruby On Rails App! </title> </head> <body> Hello World! </body> </html>
Finally, start the server like this:
./script/server
Then type this into your web browser:
http://localhost:3000
And you should see the following;
No comments:
Post a Comment