setting_up_a_rails_development_server

31
Setting up a Rails Development Server Robert Dempsey & Joe Block

Upload: webuploader

Post on 14-Dec-2014

394 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Setting_up_a_Rails_Development_Server

Setting up a Rails Development Server

Robert Dempsey & Joe Block

Page 2: Setting_up_a_Rails_Development_Server

Development Environment

• Ubuntu 5.10

• Ruby 1.8.4 / Ruby Gems

• MySQL 5

• Rails 1.1.2

• Lighttpd a.k.a. Lighty

• Subversion

Page 3: Setting_up_a_Rails_Development_Server

Ubuntu 5.10

Page 4: Setting_up_a_Rails_Development_Server

Why Choose Ubuntu 5.10

• Good documentation

• Apt-get and synaptic package manager

• Strong device support

• No viruses

• Easy to install ruby and rails!

Page 5: Setting_up_a_Rails_Development_Server

Installing Ubuntu 5.10

• Download and burn the latest iso image

• When you get to the installation prompt, hit enter

• Wait a bit for the install to finish

• Ready for customization

Page 6: Setting_up_a_Rails_Development_Server

Customizing your install

• /etc/apt/sources.list– Uncomment the universe repository– deb http://de.archive.ubuntu.com/ubuntu/

dapper main restricted– deb http://de.archive.ubuntu.com/ubuntu/

dapper universe multiverse

• Turn on ssh access to the server– apt-get install openssh-server

Page 7: Setting_up_a_Rails_Development_Server

Created /etc/apt/preferences with:

Package: *Pin: release a=breezy, v=5.10Pin-Priority: 900

Package: *Pin: release a=breezy-security, v=5.10Pin-Priority: 900

Package: *Pin: release a=breezy-updates, v=5.10Pin-Priority: 900

Package: *Pin: release a=dapperPin-Priority: 90

Page 8: Setting_up_a_Rails_Development_Server

Additional Packages

• apt-get install gcc g++ libtool libreadline5 libreadline5-dev zlib1g-dev libssl-dev libgdbm-dev libgdbm3 libgdbm-dev zlibc zlib-bin libmysqlclient14-dev subversion subversion-tools libsvn0-dev libsvn0 xtail rrdtool mysql-server mytop make

Page 9: Setting_up_a_Rails_Development_Server

Ruby 1.8.4 and Ruby Gems

Page 10: Setting_up_a_Rails_Development_Server

Installing Ruby 1.8.4

• apt-get install -t dapper irb irb1.8 libpgsql-ruby1.8 libreadline-ruby1.8 libredcloth-ruby1.8 libruby libruby1.8 libyaml-ruby ruby1.8-examples rdoc1.8 ri1.8 libmysql-ruby1.8 libgdbm-ruby1.8 imagemagick librmagick-ruby1.8 librmagick-ruby-doc xml-core libmysqlclient14-dev

• sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby• sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri• sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc

Page 11: Setting_up_a_Rails_Development_Server

Installing Ruby Gems

• Download rubygems

• Do “sudo ruby setup.rb" in the source directory.

• sudo gem update –include-dependencies

Page 12: Setting_up_a_Rails_Development_Server

MySQL 5

Page 13: Setting_up_a_Rails_Development_Server

Why Choose MySQL

• Easy to use and develop for

• Lots of good documentation

• Most hosting providers provide it free

Page 14: Setting_up_a_Rails_Development_Server

Installing MySQL

• apt-get install -t dapper mysql-server mysql-client mytop

• Set mysql password to “foo”

• sudo mysqladmin -u root password foo

Page 15: Setting_up_a_Rails_Development_Server

Rails 1.1.2

Page 16: Setting_up_a_Rails_Development_Server

Installing Rails 1.1.2

• sudo gem install rails --include-dependencies

Page 17: Setting_up_a_Rails_Development_Server

Lighttpd a.k.a. Lighty

Page 18: Setting_up_a_Rails_Development_Server

Why Choose Lighty

• FastCGI

• Virtual hosts

• Fast and secure application controlled downloads

• Works on Linux, Unix and Windows

• Flexible and configurable

• Good docs and support

Page 19: Setting_up_a_Rails_Development_Server

Installing Lighty

• apt-get install libfcgi-dev libfcgi-ruby• apt-get install libpcre3 libpcre3-dev bzip2 libbz2-

dev• wget http://www.lighttpd.net/download/lighttpd-

1.4.11.tar.gz• tar xvzf lighttpd-1.4.11.tar.gz• ./configure• time make• sudo make install

Page 20: Setting_up_a_Rails_Development_Server

Subversion

Page 21: Setting_up_a_Rails_Development_Server

Why Versioning is Good

• Online backups

• The “oh shit” factor

• Supports multiple developers– Mac: Subversion– Windows: Subversion / Tortoise SVN

• Most rails hosting companies have it built-in

Page 22: Setting_up_a_Rails_Development_Server

Configuring Subversion

• adduser repouser

• Log in as repouser

• mkdir ~repouser/sources

• svnadmin create ~repouser/sources

• Edit the configuration file to change the access rules. Set ~repouser/sources/conf/svnserve.conf

Page 23: Setting_up_a_Rails_Development_Server

Subversion continued…

• [general]

• anon-access = read

• auth-access = write

• realm = YourName Rails Repouser

• password-db = passwd

Page 24: Setting_up_a_Rails_Development_Server

Setting up the repository

• mkdir -p foo/yourapp

• mkdir -p foo/ yourapp/trunk

• mkdir -p foo/ yourapp/branches

• mkdir -p foo/ yourapp/tags

• cd foo

• svn import . file:///home/repository/sources

Page 25: Setting_up_a_Rails_Development_Server

Results

Page 26: Setting_up_a_Rails_Development_Server

What we got…

• A ready to go, stable and robust rails development server that supports multiple developers on mixed platforms

Page 27: Setting_up_a_Rails_Development_Server

Conclusions

Page 28: Setting_up_a_Rails_Development_Server

Life is good!

• Easy and worth it

• Took about 10 minutes to install

• Can use it to show clients your progress or for in-house testing

Page 29: Setting_up_a_Rails_Development_Server

Resources

Page 30: Setting_up_a_Rails_Development_Server

Resource List• Ubuntu 5.10

– http://www.ubuntu.com• Ruby 1.8.4 / Ruby Gems

– http://www.ruby-lang.org– http://rubyforge.org

• MySQL 5– http://www.mysql.com

• Rails 1.1.2– http://www.rubyonrails.org

• Lighttpd a.k.a. Lighty– http://www.lighttpd.net

• Subversion– http://subversion.tigris.org

Page 31: Setting_up_a_Rails_Development_Server

Thank You!