HostGator Web Hosting Help
Ruby on Rails: How-to install Redmine
Summary
In this tutorial you will find the instructions needed for installing a ruby on rails application known as redmine.
The version of redmine you will be installing is 2.1.4, It is one of the newer versions at the time of this article's creation.
These steps have been broken down in to 13 easy to follow steps.
Getting started
- Create rails_app folder and redmine folder within it then go inside that folder
- Download redmine 2.1.4, extract it and move the content out of it, then delete the files not being used.
- Move example files where they can be used
- Creating the MySQL Database/User/Password
- Log in to your HostGator Control Panel
- Within the database section of that cPanel, find the 'MySQL® Databases' Icon.
- Create a database, a username, and a password
- Assign the user to the database. Full permissions.
- Modifying your database.yml file
- Updating the ~/rails_apps/redmine/public/.htaccess file
- Creating the subdomain The goal is to point the subdomain to the redmine folder, if you don't have one in mind, you can simply use redmine as your subdomain;
- Log in to your HostGator Control Panel
- Within the domain section of that cPanel, find the 'Subdomains' Icon.
- Choose one of your Domain Names from the drop-down list
- Then create a subdomain going to the document root of redmine
- Creating the symlink Now you need to delete the redmine folder, you can delete this from within the ~/public_html directory.
- Updating your ~/.bashrc file Add these lines to the bottom of your ~/.bashrc file
- Running bundle install
- Running generate_session_store or generate_secret_token
- publishing the site
- Common errors
Firstly, this ruby on rails applications is considered outside the Scope of Technical Support.
Secondly, before you can follow this helpdesk article, you are going to need SSH access. If you don't know how to get SSH access, please review these other helpdesk articles.
Note: This article does expect you to understand basic command line tools, such as # vim
# mkdir -p ~/rails_apps/redmine/
# cd ~/rails_apps/redmine/
# wget http://rubyforge.org/frs/download.php/76589/redmine-2.1.4.tar.gz
# tar xvzf redmine-2.1.4.tar.gz
# mv redmine-2.1.4/* ./
# rm -rf redmine-2.1.4*
# cd config
# mv database.yml.example database.yml
# mv configuration.yml.example configuration.yml
# vim database.yml
Modify these lines
production:
adapter: mysql
database: redmine
host: localhost
username: root
password:
encoding: utf8
# cd ../public/
# pwd
You should see something similar to this;
/home#/user/rails_apps/redmine/public
# vim .htaccess
Add these lines
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
#Set this to whatever environment you'll be running in
RailsEnv production
RackBaseURI /
SetEnv GEM_HOME /home1/examplec/ruby/gems
Update this line to match the path for #pwd
SetEnv GEM_HOME /home#/user/ruby/gems
# rm -rf redmine
Creating the symlink
# ln -s ~/rails_app/redmine/public redmine
export HPATH=$HOME
export GEM_HOME=$HPATH/ruby/gems
export GEM_PATH=$GEM_HOME:/lib64/ruby/gems/1.9.3
export GEM_CACHE=$GEM_HOME/cache
export PATH=$PATH:$HPATH/ruby/gems/bin
export PATH=$PATH:$HPATH/ruby/gems
after which source your .bashrc file
# source ~/.bashrc
You will then need to check your rails version
# rails -v
You should get this message
Rails 3.2.13
If you see this an error like so
Invalid gemspec in [/home#/user/ruby/gems/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/home#/user/ruby/gems/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Open the file from the error message, in this case /home#/user/ruby/gems/specifications/mail-2.4.4.gemspec modify this line
s.date = %q{2012-03-14 00:00:00.000000000Z}
Change it to
s.date = %q{2012-03-14}
That should correct that error message. This easy to run command is also viable.
# find $HOME/ruby/gems/specifications -name \*.gemspec | xargs sed -i "s/\ 00:00:00.000000000Z//"
# cd ~/rails_apps/redmine/
# bundle install
# rake generate_session_store
the # rake generate_session_store is strictly related to redmine, some other applications may use it
After running the rake if you get this error
Invalid gemspec in [/home#/user/ruby/gems/specifications/jquery-rails-2.0.3.gemspec]: invalid date format in specification: "2012-08-16 00:00:00.000000000Z"
Again open that file /home#/user/ruby/gems/specifications/jquery-rails-2.0.3.gemspec and fix the date, if you don't know how to do that read above about 10 lines.
# bundle install
# rake generate_session_store
If you get an error saying that command is deprecated, run this command instead;
# rake generate_secret_token
# rake db:migrate RAILS_ENV=production
# rails generate controller First list
/home4/lorentzo/ruby/gems/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home#/user/ruby/gems/gems/execjs-1.4.0/lib/execjs.rb:5
from /home#/user/ruby/gems/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home#/user/ruby/gems/gems/coffee-script-2.2.0/lib/coffee_script.rb:1
from /home#/user/ruby/gems/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home#/user/ruby/gems/gems/coffee-script-2.2.0/lib/coffee-script.rb:1
from /home#/user/ruby/gems/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home#/user/ruby/gems/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1
from /home#/user/ruby/gems/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
from /home#/user/ruby/gems/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
from /home#/user/ruby/gems/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
from /home#/user/ruby/gems/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `require'
from /home#/user/ruby/gems/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
from /home#/user/ruby/gems/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
from /home#/user/ruby/gems/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
from /home#/user/rails_apps/first/config/application.rb:7
from /home#/user/ruby/gems/gems/railties-3.2.9/lib/rails/commands.rb:24:in `require'
from /home#/user/ruby/gems/gems/railties-3.2.9/lib/rails/commands.rb:24
from script/rails:6:in `require'
from script/rails:6
# gem install therubyracer
then run
# bundle install
147,330 views
bookmark
share
E-mail
Twitter
Google Bookmarks
Facebook
MySpace
Digg
Reddit
Delicious
LinkedIn
StumbleUpon
tags: