ChartDirector Ver 5.0 (Ruby Edition)
Installation
Ruby Version Compatibility
ChartDirector for Ruby requires at least Ruby 1.8.0, and has been tested up to Ruby 1.9.1 (the latest Ruby release as of the date of this document).
Extracting ChartDirector for Ruby
ChartDirector for Ruby is released as a zip file on Windows, and as a tar.gz file on Linux, FreeBSD, Solaris and Mac OS X. To use ChartDirector for Ruby, the first step is to extract the ChartDirector for Ruby distribution to an empty directory.
Running Ruby On Rails Sample Scripts
ChartDirector for Ruby comes with numerous Ruby On Rails sample scripts. They are packaged as a Ruby On Rails application in "ChartDirector/railsdemo". To run these sample scripts, you may go to the "ChartDirector/railsdemo" subdirectory, then start the application using Ruby WebBrick:
ruby script/server
After starting WebBrick, you should be able to access the ChartDirector sample scripts at port 3000.
http://127.0.0.1:3000
Running Command Line Ruby Sample Scripts
In addition to Ruby On Rails sample scripts, ChartDirector for Ruby also comes with numerous command line Ruby sample scripts in "ChartDirector/rubydemo". These scripts create charts as image files. To run them, please follow the steps below to install ChartDirector for Ruby in your system first.
Using ChartDirector in Your Own Ruby or Ruby On Rails applications
The ChartDirector for Ruby library is in "ChartDirector/railsdemo/vendor". To use ChartDirector in your own Ruby or Ruby On Rails application, you need to copy the ChartDirector for Ruby library to a directory in your Ruby module search path. You may use one of the following methods:
- Run the install.rb script in the "ChartDirector" directory. This will automatically copy the ChartDirector for Ruby library to a directory in your Ruby module search path.
ruby install.rb
You may uninstall the ChartDirector for Ruby library later by using:
ruby uninstall.rb
- If you do not want to use the automatic installation script, you may manually copy *everything* in "ChartDirector/railsdemo/vendor" (including the fonts subdirectory for Linux, FreeBSD and Solaris editions of ChartDirector) to a directory in the Ruby module search path. You may use the following command to find out the directories in your Ruby module search path:
ruby -e "puts $:"
- For Ruby On Rails applications, if you do not have write access to the Ruby module search path directories, you may copy *everything* in "ChartDirector/railsdemo/vendor" (including the fonts subdirectory for Linux, FreeBSD and Solaris editions of ChartDirector) to the "vendor" subdirectory of your Ruby On Rails application.
- For standalone Ruby scripts (such as those in the "ChartDirector/rubydemo" subdirectory), if you do not have write access to the Ruby module search path directories, you may copy *everything* in "ChartDirector/railsdemo/vendor" (including the fonts subdirectory for Linux, FreeBSD and Solaris editions of ChartDirector) to the "current working directory" (that is, "ChartDirector/rubydemo" for running the sample scripts).
Installing the ChartDirector License
If you have purchased a license to use ChartDirector, you should have a license code delivered to your via email and postal mail.
If your license key is for upgrading from a previous version of ChartDirector, you need to append the upgrade license key to the previous version license key, and use the combined license key.
There are two alternative methods to install the license key.
- Create a one-line ASCII file using Notepad or other text editor, and put the license code in that line. The whole file should contain only the license code. Name that file "chartdir.lic" and put the file in the same directory as the active "libchartdir.so" (for Linux, FreeBSD, Mac OS X and Solaris) or "chartdir.dll" (for Windows), which should be in the "vendor" subdirectory (for Ruby On Rails applications), or in the directory where the ChartDirector for Ruby module is installed or copied to (eg. "/usr/local/lib/ruby/site_lib/1.8").
If the license file appears to have no effect (does not disable the yellow banner line), and you are using ChartDirector with Ruby On Rails, please make sure the web server "anonymous user" has read access to the "chartdir.lic" file. You may copy the view file "cdinfo.rhtml" (in "ChartDirector/app/views/cddemo") to the views directory of any controller, then access that view to display a diagnostic page. The page will explain why the license cannot be loaded.
Make sure your license file is called "chartdir.lic". In particular, Notepad may automatically append ".txt" to the file name when creating a new file. So even if the file is saved as "chartdir.lic", it may end up as "chartdir.lic.txt". If this is the case, please rename the file back to "chartdir.lic".
- An alternative method is to hard code the license key into the source code by using the ChartDirector.setLicenseCode API. This method is recommended if your are redistributing ChartDirector, because your customer will then be unable to see the license key (unless your software is open source).
© 2008 Advanced Software Engineering Limited. All rights reserved.