Help getting into console

Shouldn't that be ruby script\console when you're on windows? (Notice
the backslash vs. the regular slash)

Nope. Windows understands forward slashes. The error says it cant
find a file. I'm not sure if this is a truncated backtrace, but it
appears to be looking for "environment". As I recall, you have to do
some goofing around to get the load paths working right in Windows.
Don't suppose you could just reformat c: with Ubuntu, huh? Just kidding.

What happens when you do:

ruby script/server


Rails version?

ruby script/about

A bit off topic, what I did on Windows was install cygwin. Is this an


This probably won't help, but on XP I updated Rails to 1.2.3 and Ruby
is at 1.8.5. I created a fresh project, created a database, then a
migration and:

C:\rails\test\db\migrate>cd ../..

C:\rails\test>rake db:migrate
(in C:/rails/test)
== CreatePeople: migrating

My Ruby-fu has deserted me this Sunday. I have a plugin that adds a helper to ActionView. This is an abbreviated version of the init code. When it's included by sending a :include message to ActionView::base, everything works as expected. In tests, however, the "initializing module" is printed when the module is included in the test class, but the class variables are not accessible after that. Anyone have an idea why? (BTW: I've clearly misunderstood what's going on in the base.class_eval stuff. I thought I was adding class variables -- i.e. @@analytics_key -- to whatever class mixed my stuff in, and with ActionView::Base it works.)

# the plugin (abbreviated)

module GoogleAnalyticsHelper
   def self.included(base) #nodoc#
     base.class_eval do
       puts "initializing module"
       no_analytics_key_message = 'Add your analytics key with code like GoogleAnalyticsHelper.analytics_key = "ZZ-NNNNNN-N"'
       analytics_key = nil
       analytics_base = <<-EOT
         <script src="", type="text/javascript" />
         <script type="text/javascript">
           _uacct = "%key%";

# the test (abbreviated)

require 'test/unit'
require File.dirname(__FILE__) + '/../lib/google_analytics'

class GoogleAnalyticsTest < Test::Unit::TestCase
   include GoogleAnalyticsHelper

   def test_should_raise_exception_when_key_not_set
     assert_raise {google_analytics}

It seems so incredibly unlikely that three different systems with
different versions of Ruby and of Rails could all be having the same
problem. Any chance you could totally remove Ruby and the gems on one
machine and install from scratch? I know it's a pain, but I assure
you that a fresh install of Rails does work on Windows. I did just
try it.

If you really want to dig in and find the bad actor, then maybe you
should install ruby-debug and step through the code to see where the
settings are wrong. My guess is that scrubbing Ruby and the gems and
reinstalling is a better use of your time.


Couple of things to try:

First… upgrade to 1.8.6 (or just work with the 1.8.6 machine first.


gem update --system

(that’s two dashes), This will get you the latest gems.

If that doesn’t fix your problem, check file permissions. Ensure that you are either running as an admin, or have granted appropriate rights to yourself to read and execute from c:\ruby and all subfolders, and also ensure you have access to your rails test app.

Let me know what you find out.