This page describes how to build a Ruby on Rails (nicknamed 'Rails') site in your CSE home directory.
- An account on the CSE development web server, cheshire.
- (Optional) A MySQL account.
- Login to the CSE development web server:
% ssh cheshire
- Change directory to your public_html directory:
% cd public_html
- Create a new Rails application. I've arbitrarily titled it RoR_Blog. This step installs most of your application's Ruby on Rails web application framework files into this directory.
~/public_html% rails new RoR_Blog
- Symlink your Rails application's public directory to the name by which you'll refer to the application on the web:
~/public_html% ln -s RoR_Blog/public foo
- Test. You should see the beginnings of a Ruby on Rails application:
http://www-student.cse.buffalo.edu/~userid/foo
- Create this web application's database. This will create your development and test SQLite3 databases inside the db/ folder:
~/public_html% cd RoR_Blog
RoR_Blog% rake db:create
- Create a Controller and a View:
RoR_Blog% rails generate controller home index
create app/controllers/home_controller.rb
route get "home/index"
invoke erb
create app/views/home
create app/views/home/index.html.erb
invoke test_unit
create test/functional/home_controller_test.rb
invoke helper
create app/helpers/home_helper.rb
invoke test_unit
create test/unit/helpers/home_helper_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/home.js.coffee
invoke scss
create app/assets/stylesheets/home.css.scss
- Figure out how to get Apache and Phusion Passenger (mod_rails) configured to serve RoR apps in per-user public_html directories.
- AllowOverride Options is on in user home directories, so configure RailsBaseURI/RackBaseURI in .htaccess files? Disable MultiViews.
- http://guides.rubyonrails.org/getting_started.html
- http://www.modrails.com/documentation/Users%20guide%20Apache.html