[BUG?] Rails installation -- first in a series

Hi nice guys!

I've been using Rails for a couple of days. I've got to say that Rails
do meet the buzzword expectations... Every part of Rails amazes me,
especially Active Record. I come from the PHP world where there are
vast choices of "DB abstraction layer" we can choose, from the
"minimalist" PEAR DB, to PEAR MDB, and what I'd say the most advanced
ones like Creole+Propel. Active Record definitely wins by several
hands. I wonder how much time David (and Rails contributors) has spent
on Active Record alone, let alone the entire Rails package. The
Migration feature is very handy, the concept is simple yet it works.
Some packages like PEAR MDB uses schema comparison approach, which is
very complex (especially for MB developers) and also not very easy to
use. Although MDB's technique also automates it a bit (basically you
define a target schema, and MDB will modify the current database to
match the target, but I like Migration's approach much better).

Anyways, I've come across several problems. Maybe bugs, maybe not. In
any case I was hoping if it can be enhanced even if not fixed, so not
everyone will face these problems again. At the very least, giving a
helpful error message would be really great. So, let's get started...

The first difficulty is getting the first Rails app to work. I'm using
Ruby one-click Installer on Windows XP. The installer works great.
Rails, though, not that smooth. I choose to download the
"rails-x.x.x.tgz" since it claims to have the entire package (I do
aware that Rails uses activerecord, etc. gems, but I don't download it
since the "entire package" supposedly has them). Note that I don't
have active Internet connection, I go to Internet cafe to download all
the stuff I need then I go back home to try what I've downloaded. That
means if I missed a needed part, I've to go back to Internet cafe
again, and that's not nice.

Extracted rails-1.1.6.tgz. Trying... But, it turns out that "ruby
script/server" fails:

D:\rails>ruby script/server
=> Booting WEBrick...
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_re
quire': ./script/../config/../config/environment.rb:8: parse error, unexpected '
<' (SyntaxError)
<%= '# ' if freeze %>RAILS_GEM_VERSION = '<%= Rails::VERSION::STRING %>'
^ from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
        from ./script/../config/../vendor/rails/activesupport/lib/active_support
/dependencies.rb:147:in `require'
        from ./script/../config/../vendor/rails/railties/lib/commands/servers/we
brick.rb:52
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
m_original_require'
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
        from ./script/../config/../vendor/rails/activesupport/lib/active_support
/dependencies.rb:147:in `require'
        from ./script/../config/../vendor/rails/railties/lib/commands/server.rb:
30
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
m_original_require'
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
        from script/server:3

Definitely not a very nice experience.

After banging my head several times, I figured that I've to download
the rails gem and all the gems it requires. Another roundtrip to
Internet cafe. I can't find a page on Rails download page that lists
direct link URLs to all gems I need [BAD], maybe it's somewhere but it
should be very visible upfront to avoid frustrations. I also can't
find a Rails download that includes all the Rails gems and its
supportive files in one .tgz or .zip file (BAD). I'm aware of
InstantRails, but it seems more like a "distro" rather than a
collection of needed support files, therefore I don't download it.

The "solution" is to install Ruby on the computer that's connected to
the Internet. Then I execute the recommended way of installing rails :
gem install rails --include-dependencies
Took some time. But it works. The problem is, you can't just install
Ruby on every computer you need to use to download Rails. Why not just
pack a bunch of gems in one tgz/zip to make some people's life easier?

The problem was, how do I copy the required .gem-s to my computer? It
turns out I have to mess with C:\ruby\lib\ruby folder to find the gems
I need, copy those to my flashdisk and bring them home. OK, mission
accomplished.

[another annoyance, not directly related to Rails] The problem with
installing .gems from localdisk is that gem doesn't seem to
autoinstall dependencies (not like online gem install from Internet).
The way that some people actually think that most people in the world
have 24-hour Internet connection at the luxury of their home computers
definitely disgusts me (sorry). After manually installing all required
gems, a call to rails to build a site, then 'ruby script/server'
works. Oh, at last.

But why did I has to be so painful to get here?

A side note: Installing Apache + PHP on Windows is also not that easy
(it's much harder than installing Ruby/Rails, IMHO, requires you to
edit some files like httpd.conf, php.ini, PATH env, etc.). At the very
least, it doesn't require active Internet connection and having to
install some program (like Ruby + rubygem) just to download something.
All I need would be the Apache binary package, the PHP zip package,
and the PHP manual which contains everything you need to know to
install, configure, develop (it includes User Guide as well as
Reference), even to create PHP extensions using C! (the enhanced CHM
version even comes with user comments, definitely a plus).

Sorry for the complaints, but it'd be great if we could have more ways
to make Rails better and easier to use.

Thanks for your feedback Hendy - this is actually a bug report :slight_smile: The Rails 1.1.6 tarball includes the environment.rb template instead of a ‘real’ generated file. If this problem is fixed, the tarball install should work fine for you. Sorry for the frustration (and extra trips to the internet cafe!)

jeremy

The way that some people actually think that most people in the world
have 24-hour Internet connection at the luxury of their home computers
definitely disgusts me (sorry).

Of course, not everybody has that luxury. But I don't think its unfair to assume that a web developer would have some kind of home internet connection. I'm not sure how you could possibly work efficiently and easily without one.

Cheers
Luke Redpath

> The way that some people actually think that most people in the world
> have 24-hour Internet connection at the luxury of their home computers
> definitely disgusts me (sorry).

Of course, not everybody has that luxury. But I don't think its
unfair to assume that a web developer would have some kind of home
internet connection. I'm not sure how you could possibly work
efficiently and easily without one.

I agree on "efficiently and easily". It's definitely not efficient and
not easy. Although I'd say it's more efficient cost-wise (now don't say
that Internet connection is cheap, no part of the world is the same).

However I can't disagree more on the "possibly" clause. It's definitely
possible. Once you have your development environment set up, there are
LOTS of things you can do offline. (and lots more when online).
Developing an entire CMS is possible offline. Of course, if you want to
do some online stuff, like RSS aggregating or integration with Flickr's
API, you need to be online to test it with the real world. Otherwise,
most of the stuff web developers do is possible to be done without the
Internet. There are server software that can be installed for
development purposes, and some frameworks even include tests, mocks,
and fixtures, to help offline development. Although (maybe) some people
prefer to work with the real database server using the 'production'
environment setting while debugging their apps, it's their choice.

This is not saying that I don't like online development (or more
accurately, development while being connected to the Internet,
regardless whether the Internet is in use or not). But just to say that
I don't like using/installing/developing something that "mandates"
Internet connection just to install it in the first place (not to
deploy it, which is obviously necessary). Rails is not such an app, but
it looks like such an app and I definitely think so because I had to
install Ruby first then run 'gem install rails' on a computer that's
not even my development computer!

All I ask would be just some clearness in the download page, come on it
may be hard to give these three options:
1. download a (currently) broken rails-x.x.x.tgz package and you're
set!
2. gem install rails (which requires Ruby + gem installed on the
downloading computer)
3. download a .tgz/.zip containing rails-x-x-x.gem and all required
gems (or, alternatively, just give direct links to each of the required
gems so I can just select these and click "FlashGot selection")
4. (optional, but really helpful + I recommend highly) download a .zip
file containing the Rails API, Rails HOWTO, Rails WIKI, Rails docs and
whatever you want to put there so it makes the world more like heaven
for unlucky people like me. (some may want to say just "gem rdoc --all"
or "rails doc:rails" but this doesn't work in my case, but this will be
my "bug" report in the next series, coming soon in theaters in your
city)

But...

The 3rd option will make life easier for poor people like me.

The 4th option will make life even easier for people like me and for
some others, too. Even if I have 24/7 Internet connection, why would I
connect to the Internet when I can browse all docs offline, and I can
search blindingly fast after installing something like Google Desktop?

Jeremy Kemper wrote:

Thanks Mr. Kemper...

Anyways, it'd be greater if we can have a tarball of all needed gems
instead of a "rails working directory". I think it'd be more useful. If
it's already there somewhere it'd be great if it can be listed in the
rubyonrails download page.

Isn't this what instant rails or locomotive try to solve? One
download which includes everything you need to get up and running with
rails?