Showing posts with label Ruby. Show all posts
Showing posts with label Ruby. Show all posts

Monday, June 18, 2012

Use Bitnami Redmine for deploy of my redmine version

I need to deploy Redmine on windows ,to minimize work and issues, I use Bitnami Redmine for windows installer.
I will update the installtion to use my own custom version of redmine , that will be stored on a remote git branch (currently github).

The steps

1. Install redmine stack from bitnami , make sure that every thing is working (browser), then stop all services of Redmine stack.
2.  Goto BitNami\RedmineStack\apps\redmine folder , rename the "htdocs" folder to "htdocs_org" and create a new blank "htdocs" folder.
3. In the blank "htdocs" folder , we will init a new git repo and link it to our remote branch by doing :

cd htdocs
git init
git remote add -t my_work -f origin git://github.com/haimlankry/redmine-1.git
git checkout my_work


At this stage you should have a full redmine project from your git, now will copy some data from the original folder.


4. Copy the folowing folders and files from "htdocs_org" to "htdocs" in the relevant location
root: .bundle, bin , Gemfile.lock 
config/database.yml configuration.rb and additional_environment.rb
tmp/ cache sessions and sockets folder
config\initializers\secret_token.rb

5. Add to the Gemfile the line: gem 'thin' #(if it is not allready in the gemfile)

Test your settings buy starting the thin server, (takes a while on windows) :
start mysql using the service manager utility (or any other way) then type:
bundle exec thin start -e production -p 3001 --prefix /redmine

This should start a thin webserver listens on port 3001 , you can check on the browser for :
http://localhost:3001/redmine
This should result in the redmine home page.

Thats it , now you can develop on your machine , push to git hub, then "git clone" on deploy to get latest update.

Monday, June 4, 2012

EC2 linux rvm ruby rails install steps

Steps to install ec2 amazon linux with rails


An old ruby version is required, currently it is intalled by default (v1.8.7), if not, install it using "yum install ruby" .

Steps

sudo -s
yum install -y git gcc-c++ autoconf automake make patch
yum install -y bzip2 readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel iconv-devel

curl -L get.rvm.io | bash -s stable

gpasswd -a ec2-user rvm
source /etc/profile.d/rvm.sh
yum install -y bison
run the follwing to see that things are OK:
rvm requirements 


## for problems with rvm and kernel header file:
vi /etc/yum.conf
change the line to comment : #exclude=kernel*
yum install kernel-headers  
======

Install ruby

rvm install 1.9.3-head


## create a new gemset and set the ruby and gemset to be default by rvm

rvm gemset create mygemset

rvm use 1.9.3-head@mygemset --default

# ruby is ready with rvm , now install rails (without documentation)

gem install rails -v 3.2.2 --no-rdoc --no-ri


next steps:
- install database 
- install passanger with apache

Monday, April 9, 2012

comment visual block vim

select your lines using visual block: CTRL+v
type I to go to insert mode before the block
type the comment char (e.g. #)
press ESC