After much toil and pain I finally got my Radiant CMS installation working. I am going to post a simplified version of the procedure that I followed. This is by no means a comprehensive tutorial but should work on site5 hosts, at least for now. This is only slightly different from the official documentation on the git.

Log into your account using SSH

I am assuming you know how to do this. Mac users can use native terminal or iterm ( you may need to download if you don’t have this) and windows users can use a client similar to putty.


$ssh username@yourdomain

First Install your own Radiant CMS as local gem

Verify the contents of the following files and make changes if necessary. Important information is in bold –


# cat .gemrc
---
gem: --remote --gen-rdoc --run-tests
gemhome: /home/username/ruby/gems
gempath: []

- /home/username/ruby/gems
- /usr/lib/ruby/gems/1.8

rdoc: --inline-source --line-number

Edit your profile so that the GEM_PATH & GEM_HOME paths are set appropriately.


# cat .bash_profile
export PATH=$PATH:$HOME/bin:$HOME/ruby/gems/bin


export GEM_PATH=/home/username/.gem/ruby/1.8:/usr/lib/ruby/gems/1.8:/home/username/ruby/gems
export GEM_HOME=/home/username/.gem/ruby/1.8:/home/username/ruby/gems

Verify your GEM environment –

# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
- INSTALLATION DIRECTORY: /home/username/ruby/gems
- RUBY EXECUTABLE: /usr/bin/ruby
- EXECUTABLE DIRECTORY: /home/username/ruby/gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/username/ruby/gems
- /usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gempath" => ["/home/username/ruby/gems", "/usr/lib/ruby/gems/1.8"]
- "gem" => "--remote --gen-rdoc --run-tests"
- "gemhome" => "/home/username/ruby/gems"
- "rdoc" => "--inline-source --line-numbers"
- REMOTE SOURCES:
- http://gems.rubyforge.org/

If you had to make any changes in the .bash_profile or in .gemrc I recommend you to logout and log back in. Alternately you can source these files from command line as well.

Now lets install the Radiant gem –


# gem install radiant
Building native extensions. This could take a while...
Successfully installed RedCloth-4.2.2
Successfully installed radiant-0.8.1
2 gems installed
Installing ri documentation for RedCloth-4.2.2...
Installing ri documentation for radiant-0.8.1...
Installing RDoc documentation for RedCloth-4.2.2...
Installing RDoc documentation for radiant-0.8.1...

If you don’t see the lines pertaining to RedCloth, don’t worry too much. It may be that your environment already has gotten one. If you must verify for its existence all your local gems should reside in the following path –

~/ruby/gems/bin/

Now lets create Our Application –

Here is the command to do just that –


# radiant --database mysql myapp

I am not displaying all the output here to avoid unnecessary clutter.

Configuration Changes –

Now lets configure the app with the necessary database and other environmental settings.

Here is the sample database.yml output –


production:
adapter: mysql
database: my_prod_db
username: my_prod_user
password: my_prod_pass
host: localhost
reconnect: true


development:
adapter: mysql
database: my_dev_db
username: my_dev_user
password: my_dev_pass
host: localhost
reconnect: true


test:
adapter: mysql
database: my_test_db
username: my_test_user
password: my_test_pass
host: localhost
reconnect: true

Please change the values for db, user and password in accordance with your environment. Also you can omit any environments that you may not want to use, but those changes must reflect in your environment.rb otherwise you may get errors during the db migration.

In my case I only choose to use the production environment. So, I trimmed the database.yml to something like below –


production:
adapter: mysql
database: my_prod_db
username: my_prod_user
password: my_pass
host: localhost
reconnect: true

Now lets edit the file ‘myapp/config/environment.rb’ with the following changes :

This line –


# ENV['RAILS_ENV'] ||= 'production'

will become this –


ENV['RAILS_ENV'] ||= 'production'
ENV['GEM_PATH'] = '/home/username/.gem/ruby/1.8:/usr/lib/ruby/gems/1.8:/home/username/ruby/gems'

and this –


config.middleware.use ::Radiant::Cache

to this –


# config.middleware.use ::Radiant::Cache

The last step above will disable caching. What I found several issues with caching enabled, including –

1. CSS does not get rendered properly
2. Every link on the website only serves the index page
3. Some times I was able to get past index page but the results were very inconsistent

I will post a remedy for the above situation when I find it. Please reply to the post if you already know a solution to this issue.

Bootstrapping the Database –

Now it is time to populate the database with the demo data.


# cd mypp/
# rake production db:bootstrap
(in /home/username/myapp)
This task will destroy any data in the database. Are you sure you want to
continue? [yn] y
== CreateRadiantTables: migrating ============================================

….WHOLE BUNCH OF OUTPUT…

Create the admin user (press enter for defaults).
Name (Administrator):
Username (admin):
Password (radiant):


Initializing configuration.........OK


Select a database template:
1. Empty
2. Roasters (a coffee-themed blog / brochure)
3. Simple Blog
4. Styled Blog
[1-4]: 2 (I chose 2 you can choose your own)


Creating Snippets....OK
Creating Pages....OK
Creating Layouts....OK
Creating Page parts....OK


Finished.

Setting up the Symbolic Link

On site5 and many other services the domain is usually pointed to ‘public_html’ directory under the users home directory. Since anything that is outside this directory is not visible to the webserver lets point the public_html to our application directory. To accomplish this do the following –


# mv public_html public_html_bak
# ln -s myapp public_html

That is it. Now point your browser to www.yourwebsite.com or whatever that is and enjoy. To go to the admin pages point the browser to www.yourwebsite.com/admin.

Share