Cannot get rails rolling

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?

Hi Lloyd,

Lloyd L. wrote:

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 :wink:

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.

Best regards,
Bill

Hi Lloyd,

Lloyd L. wrote:

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 have a fairly detailed intro to Rails that includes setup and a sample
project available at
Cooking With Ruby On Rails 4 - A Rails Crash Course | New Auburn Personal Computer Services LLC. 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.

On Wed, Aug 20, 2008 at 10:09 AM, Lloyd L. <

On 2008-08-21 05:49, Lloyd L. wrote:

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.

Bill W. wrote:

Hi Lloyd,

Lloyd L. wrote:

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.

Is there a way to specify such things?

Greg D. wrote:

On 2008-08-21 05:49, Lloyd L. wrote:

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?

Frederick C. wrote:

On 22 Aug 2008, at 16:49, Lloyd L. wrote:

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 set the http_proxy environment variable gem should use it

Fred

Thanks Fred! That was what I needed to find this:

Unfortunately, it did not work for me as the error remains the same, but
I appreciate it nonetheless. :slight_smile:

On 22 Aug 2008, at 16:49, Lloyd L. wrote:

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 set the http_proxy environment variable gem should use it

Fred

Here’s something else to try–execute the command:

set
http_proxy=http://win_username_here:[email protected]:8080

(With appropriate values subbed in for win_username_here &
win_password_here & proxy server/port.)

at a command prompt immediately prior to calling the ‘gem’ command.
That works for me…

HTH,

-Roy

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:

  1. Start InstantRails (I am assuming you are using InstantRails 2?).
  2. Open up the InstantRails console
  3. Click on I to display the menu choices
  4. Select Rails Applications followed by Ruby Console
  5. You should see a DOS window with the current directory as
    C:…\rails_apps
  6. Use this window to run your gem commands since all kinds of
    environment variables are automatically set for you here
  7. A few times I have experienced time-out errors
  8. 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:

“Ruby & Rails Developer Bundle”

Then try to build one of the tutorial apps. Best of luck!

Cheers,
Robby

On Wed, Aug 20, 2008 at 7:21 AM, Lloyd L.
[email protected] wrote:

in at the location given, it could not find the correct thing to run as

what the tutorial says can be done? What magical piece of the puzzle is
Posted via http://www.ruby-forum.com/.


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting

http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]