I have been trying to get the 30 minutes tutorial “Rolling with Ruby on
Rails revisited” going for a week now with zero luck. (Actually, I am
trying this at work as I am the one tasked to see how usable it all is,
so it was a work week, meaning 40ish hours.)
I got instant rails, as the tutorial said I should, but it could not
connect to MySQL. I changed this and that and got it to connect. Then,
I could not get it to generate the new application. (That is the part
where I type in “rails cookbook2”. The problem was that, if I typed it
in at the location given, it could not find the correct thing to run as
if there was a pathing problem. I searched for executables called
“rails”, found one and pointed there and it ran. Then, when I tried to
run the next rails command, “ruby script\generate scaffold recipe
recipe” I could not get it to do anything noticeable at all. Well, I
struggled with this until the frustration meter pegged again, so I
deleted it all and got a different version of instant rails (from
rubyforge).
Well, now I can, again, no longer connect to MySQL but this time I
cannot run apache from InstantRails.exe either.
If I have to spend a week to get the rails version of “hello world”
going, I might as well be using Java. I apologize for the exasperation
but as wondrous as ruby is linguistically, the gold seems to turn to
dross whenever I try to actually do something with it. All academic and
theoretical coding exercises are a joy. All attempts at usable
programming have been crushing.
Ok. Enough of the scream of ultimate anguish.
What is the secret and occult mystery of how to get rails to actually do
what the tutorial says can be done? What magical piece of the puzzle is
omitted that makes it actually work and why has no one else noticed that
doing exactly what it says to do will not yield the results promised?
At the least, can someone point me to a tutorial that will actually
work? I have bought many books on Ruby but none of them work (for me)
for anything but snippets of 10 lines or less. Anything that will break
the log jam will suffice. I am not asking for anyone to do the work for
me. I just want to be able to do the work for myself but rails seems to
be fighting me all the way and winning.
I have tried the approach as spelled out in “Agile Web D. with
Rails”. I installed ruby, again. Then it said to type this:
gem install rails --include-dependencies
(page 20)
The book then triumphantly declares “congrat-ulations, you are on
rails”.
I get this message:
ERROR: While executing gem … Gen::RemoteFtecher::FetchError
A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond. - connect<2>Errno::ETIMEDOUT
Well, it sounds as if I do not have internet connectivity, which this
posting contradicts.
I am running out of rails books and tutorials to follow. Can someone
point me in the right direction, please?
I have been trying to get the 30 minutes tutorial
“Rolling with Ruby on Rails revisited” going for
a week now with zero luck. (Actually, I am
trying this at work as I am the one tasked to see
how usable it all is, so it was a work week, meaning
40ish hours.)
Ok. Enough of the scream of ultimate anguish.
I’m sorry to hear you’ve had difficulty and wish you’d posted to the
comments section at OReilly sooner. I still respond to postings there.
The
difficulties you describe are not unique and most often result from one
of
two things. First, some folks miss the NOTE: at the top of the tutorial
that points out that it’s not updated yet to support Rails 2.x. There
are
several postings in the comments section where that’s caused readers
difficulties that went away when they dropped back to the supported
version
of InstantRails. Second, if there is another service running on a port
that
InstantRails uses by default, it won’t be able to start one or both of
MySQL
or Apache. It often happens, for example, that a reader already has
MySQL
running as a service and needs to shut it down so that InstantRails can
start its own instance. Apache’s not needed at all in a development
mode
and I always shut it down immediatedly after starting InstantRails.
IIRC,
the tutorial says to do so, but my memory’s not what it once was
What is the secret and occult mystery of how to get rails
to actually do what the tutorial says can be done? What
magical piece of the puzzle is omitted that makes it actually
work and why has no one else noticed that doing exactly
what it says to do will not yield the results promised?
AFAIK, there’s no mystery. My own journey had its rough spots, but they
typically turned out to derive from assumptions about how things work
that
turn out to work a little differently, albeit much more easily, in
Rails.
At any rate, I’m happy to help you discover and overcome whatever’s
tripping
you up. Feel free to post here, on OReilly, or to contact me directly
at
bill dot walton at charter.net.
ERROR: While executing gem … Gen::RemoteFtecher::FetchError
A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond. - connect<2>Errno::ETIMEDOUT
Looks like the remote server timed out. Happens from time to time. Try
again.
I have a fairly detailed intro to Rails that includes setup and a sample
project available at http://www.napcs.com/resources/rails/cookbook/index.html. Perhaps that
can
help you. It’s something I used to use for internal training but I’ve
decided to share it with the general public. As you can imagine, it’s
gone
through several revisions. While it says it works with Rails 2.0.2, it
does
work for Rails 2.1 as well. Instructions for installing Ruby on Rails
and
SQLite3 are included.
I tried several times and it is always the same. I am guessing that it
is because the firewall requires a username and pw to get onto the
internet. (work requirements) If the gem install needs internet
access, then, unless I can enter a username and pw, I cannot install.
Is there a way to specify such things?
Yes, environment variables. Google for http_proxy or ftp_proxy.
ERROR: While executing gem … Gen::RemoteFtecher::FetchError
A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond. - connect<2>Errno::ETIMEDOUT
Looks like the remote server timed out. Happens from time to time. Try
again.
Best regards,
Bill
I tried several times and it is always the same. I am guessing that it
is because the firewall requires a username and pw to get onto the
internet. (work requirements) If the gem install needs internet
access, then, unless I can enter a username and pw, I cannot install.
I tried several times and it is always the same. I am guessing that it
is because the firewall requires a username and pw to get onto the
internet. (work requirements) If the gem install needs internet
access, then, unless I can enter a username and pw, I cannot install.
Is there a way to specify such things?
Yes, environment variables. Google for http_proxy or ftp_proxy.
–
Greg D.
I know how to do it with various browsers. How to do it when the
command is gem install is not so obvious, or were you making a joke?
If you are using InstantRails on Windows XP and trying to run gem
commands from a plain DOS window, you will experience all kinds of
problems. Instead, what you want to do is:
Start InstantRails (I am assuming you are using InstantRails 2?).
Open up the InstantRails console
Click on I to display the menu choices
Select Rails Applications followed by Ruby Console
You should see a DOS window with the current directory as
C:…\rails_apps
Use this window to run your gem commands since all kinds of
environment variables are automatically set for you here
A few times I have experienced time-out errors
However, if it persists then the problem is definitely in the proxy
settings to prove it to yourself, take your laptop to some other place
out of your office (home may be?) and try to execute the gem commands as
explained above. If you are successful then the problem is in your
proxy settings.
Let us know how it goes
Another option to throw out there is to look at using the “Ruby &
Rails Developer Bundle” from EnterpriseDB (PostgreSQL w/addons). It
contains the entire Ruby/Rails stack on top of PostgreSQL (which I’ll
argue is a better db…)
Not tried it on Windows, but they have a release here: