SitePoint Sponsor

User Tag List

Results 1 to 17 of 17

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2004
    Location
    Yakima WA.
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installation instructions for whole rails stack

    OK here is some good instructions that will take you step by step installing the whole ruby/rubygems/rails/lighttpd/fcgi/php stack. Hope it helps someone.

    These instructions work on OSX, most linux distros and FreeBSD
    You can skip ruby if you already have a good copy. But if you only have the
    stock ruby that comes with OSX I would compile it from source and rename the
    stock OSX ruby and irb to ruby.bak and irb.bak so you don't end up using
    them on accident.
    __________________________________________________ ______________
    Get Ruby1.8.2

    curl -O http://rubyforge.org/frs/download.ph...y-1.8.2.tar.gz
    tar xvzf ruby-*
    cd ruby-1.8.2
    ./configure
    make
    make test
    sudo make install
    __________________________________________________ ______________

    Get Ruby gems

    curl -O http://rubyforge.org/frs/download.ph...ems-0.8.10.tgz
    tar xvzf rubygems*
    cd rubygems*
    sudo ruby setup.rb
    __________________________________________________ ______________

    Get Rails and a few other gems

    sudo gem install rails RedCloth search_generator salted_login_generator production_log_analyzer
    answer yes to all dependencies
    __________________________________________________ ______________

    Get mysql-ruby C bindings (the pure ruby ones suck)
    This command works great on osx as well using the mysql 4.1.x installer from mysql.com
    or the serverlogistics.com mysql as well.

    curl -O http://www.tmtm.org/en/mysql/ruby/mysql-ruby-2.7.tar.gz
    tar zxvf mysql-ruby-*
    cd mysql-ruby-*
    ruby extconf.rb --with-mysql-config
    make
    sudo make install
    __________________________________________________ ______________

    download fastcgi developers kit

    curl -O http://fastcgi.com/dist/fcgi.tar.gz
    tar xvzf fcgi-2.4.0.tar.gz
    cd fcgi*
    ./configure
    make
    sudo make install
    __________________________________________________ ______________

    Get the new non memory leaking ruby-fastcgi bindings

    curl -O http://sugi.nemui.org/pub/ruby/fcgi/...i-0.8.6.tar.gz
    tar xzvf ruby-fcgi*
    ruby install.rb config --without-ext
    ruby install.rb setup
    sudo ruby install.rb install
    __________________________________________________ ______________

    We need the correct pcre .soís for lighttpd to work correctly

    curl -O ftp://ftp.csx.cam.ac.uk/pub/software...cre-5.0.tar.gz
    tar xzvf pcre-5.0.tar.gz
    cd pcre-*
    ./configure
    make
    sudo make install
    __________________________________________________ ______________

    Get lighttpd
    You can install lighttpd 1.4.4 if you want. I'm still using 1.3.16 until
    the 1.4 branch settles down.

    curl -O http://www.lighttpd.net/download/lighttpd-1.3.16.tar.gz
    tar xzvf lighttpd-1.3.13.tar.gz
    cd lighttpd-*
    ./configure
    make
    sudo make install
    __________________________________________________ ______________

    Compile php as a fast-cgi binary The main thing here is the following configure options. You can add whatever else you like to your php binary but these are needed for fast-cgi support.

    $ ./configure \
    --enable-fastcgi \
    --enable-discard-path \
    --enable-force-cgi-redirect \
    __________________________________________________ ______________

    Lighttpd Launcher Script

    Here is a link for a sweet enhancement. Put this script in your RAILS_ROOT/script folder and put the lighttpd.conf file in RAILS_ROOT/config. Now you can launch your rails app by cdíing into your RAILS_ROOT for your app and typing:
    $ruby script/lighty -p 7500 -e development (or whatever port & env you want to use)

    Now you can hit http://localhost:7500/ and you will get your app running on lighttpd no muss no fuss. Very sweet for development. Here is the link: http://www.bigbold.com/snippets/posts/show/303 . Name the first ruby script lighty and name the config file lighttpd.conf. Now every time you start your app this way is creates a new lighttpd.conf in /tmp and starts lighttpd up with that file. This way you can give it command line options as to what port to bind to and others. Iím using this for development and it is sweet!

  2. #2
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yer, might hook up my laptop and give it a go I suppose, but really I'm in no hurry

  3. #3
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Yer, might hook up my laptop and give it a go I suppose, but really I'm in no hurry
    Oh, so you've joined the darkside and decided to look at ruby after not believing the hype for so long :P

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I really need to build a Linux box. My current desktop has way too many web servers on it (Tomcat, Apache/PHP, WEBrick for RoR)

  5. #5
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    I really need to build a Linux box. My current desktop has way too many web servers on it (Tomcat, Apache/PHP, WEBrick for RoR)
    This is whee something like VMware comes in handy.... with version 5, it's nice coz you can make a base install of Windows and/or linux and then make a linked clone to make customised versions. I have a virtual machine I will use for university work (which I can rsync to and fro from the laptop), one for test linux, one for playing about with Windows server stuff (i.e. if I need to use RIS to deploy workstation PC's, or use ASP.NET if I need to help a friend who uses that) etc etc. The nice thing I find is if you screw stuff up, you can quickly revert to earlier snapshots etc. Likewise, unlike dual boot, you don't have to keep switching OSes (which is something I found as you often install Linux, then have to go back to you other OS to download network/modem/ADSL drivers). Also, I can use the same virtual machines wherther I'm in Linux or doze (handy if I need to use VS.NET say from Linux)

  6. #6
    SitePoint Addict dek's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well - over the last month, I've tried every single set of installation instructions I've been able to find, on both Windows XP and MacOSX (Tiger)

    and totally failed, until two days ago, to get a working Rails setup.
    Which is kind of embarrassing for a professional programmer, even if it was in my spare time.

    The closest I'd manager was under Tiger, where I got the standard MySQL problem.

    FINALLY managed to get it working, under Tiger, using Locomotive, which makes it almost ludicrously simple (it took five minutes, from the time I clicked on the Locomotive link.)

    Highly recommended for any other OSX folk with problems.

    Now I just need to find the time to actually try it out...
    Only dead fish go with the flow

  7. #7
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dek
    Well - over the last month, I've tried every single set of installation instructions I've been able to find, on both Windows XP and MacOSX (Tiger)

    and totally failed, until two days ago, to get a working Rails setup.
    Which is kind of embarrassing for a professional programmer, even if it was in my spare time.

    The closest I'd manager was under Tiger, where I got the standard MySQL problem.

    FINALLY managed to get it working, under Tiger, using Locomotive, which makes it almost ludicrously simple (it took five minutes, from the time I clicked on the Locomotive link.)

    Highly recommended for any other OSX folk with problems.

    Now I just need to find the time to actually try it out...

    I found (well my ex-boss) on OS X if you follow the right instructions generally things work. However, he did run into some issues I think at times, such as MySQL used to play up if you used CocoaMySQL

  8. #8
    SitePoint Addict dek's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MiiJaySung
    I found (well my ex-boss) on OS X if you follow the right instructions generally things work. However, he did run into some issues I think at times, such as MySQL used to play up if you used CocoaMySQL
    Generally, yes. But for a lot of people, no.
    There's no point in giving a blow-by-blow here, as I've now got it installed, but problems usually seem to revolve around MySQL integration.

    If you use MySQL 4.0.x, there shouldn't be a problem. If you use 4.1.x, you may well need to install the latest ruby_mysql - and not everyone manages that one. I've googled to death the link errors that I was getting - and can find no mention of them. Hence my joy at finding Locomotive.
    Only dead fish go with the flow

  9. #9
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there really any need to download and compile so many source packageS?

    I'd personally advise sticking to your distro of choices package management tool if at all possible, whether its apt, portage whatever. Grab Ruby, irb, rdoc and rake via your distros package management tool to get yourself up and running with Ruby, grab rubygems if your package manager also has it otherwise dload/compile/install, then use gems for your ruby packages; you'll need Rails and dependencies, the bindings for your database - MySQL and PostgreSQL both have pure Ruby and C bindings, and I'd also advise grabbing Bluecloth and Redcloth too.

    Most package management systems should have the above, as well as Apache2 and lighttpd.

  10. #10
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is instant rails too.
    For development I use XAMPP + Ruby One Click Installer + gem install rails.

  11. #11
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, so you've joined the darkside and decided to look at ruby after not believing the hype for so long :P
    Not so fast... I said I wasn't in any hurry. I'm still not btw

  12. #12
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alternatively if you use gentoo

    emerge mysql
    emerge lighttpd
    emerge rails
    emerge ruby-fcgi

    will probably do the trick. I have a load of stuff like -java -php -apache -X etc to stop all the evil trimmings getting installed

  13. #13
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Guys, I really don't like the
    ./configure && make && make install
    path because it's hard to uninstall or upgrade such software.
    And sometimes there are no precompiled RPMs.

    Does anyone have any experience or tips on building RPMs ? I tried to look at docs but it doesn't seem an easy task. Maybe you guys know of some quick and dirty path ?

  14. #14
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did briefly look at building RPM's and to be honest, it's a nightmare. RPM is not the way forward.

    if you are going down the autoconf route, I have seen people change the --prefix bit, so you compile the app outside the main bin/lib/include dirs for the fs. after that you can then modify your path variables to point to these external places. That way it is easier to manage for Makefiles such as apache which have no uninstall target. I haven't done this myself really, I normally just bite the bullet and build into /usr on RH systems.

    Alternatively, use Gentoo, and then you have the flexiblity of compiling without compromising the ablity to uninstall, update etc. I would assume if you used an "testing" branch of debian, you can also get most things with apt get

  15. #15
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MiiJaySung
    I did briefly look at building RPM's and to be honest, it's a nightmare. RPM is not the way forward.

    ...

    Alternatively, use Gentoo, and then you have the flexiblity of compiling without compromising the ablity to uninstall, update etc. I would assume if you used an "testing" branch of debian, you can also get most things with apt get
    I cannot use Gentoo. I must use RedHat and derivates (Fedora Core).
    All the servers I work on have Red Hat Enterprise 3 and at home I have Fedora Core 4.

    It is easy to install software in Fedora Core 4 because now it comes with YUM but that's as long as there are the right RPM packages in the repositories.

  16. #16
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    I cannot use Gentoo. I must use RedHat and derivates (Fedora Core).
    All the servers I work on have Red Hat Enterprise 3 and at home I have Fedora Core 4.

    It is easy to install software in Fedora Core 4 because now it comes with YUM but that's as long as there are the right RPM packages in the repositories.
    Ditto in my last job. However, I personally was getting frustrated with Redhat distros in general. Mainly because RPM is showing it's age / flaws and the release cycles are very slow. It's only in recent weeks I have ventured into other distros myself (having started learning linux using RH).

    The problem with CentOS / RHEL is that if you can't get RPMs (which is often the case if the package is newer than a year), then you have to compile. The fun comes in with things like Apache and PHP which seem to have endless dependacies I found. That is one reason why I don't miss Apache or PHP.

    I have no idea why so many hosting companies settle with Fedora, as I found it so buggy, and RHEL is so out dated. In fact I'm sure Debian's stable branch these days is more up to date!

  17. #17
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh yea, we also had issues with MySQL Ruby C bindings. They seem to be a curse too on windows as well it seems


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •