(newb) installing rails

Discussion in 'Ruby' started by luke, Jun 11, 2005.

  1. luke

    luke Guest

    hi i've been having a bit of difficulty installing rails. i've downloaded
    and installed the ruby 1.82-16 one-click installer, but when i open a
    command prompt and type in gem install rails --remote i get a 'bad command
    or file name' message. i'm using win98.

    thanks
    luke
     
    luke, Jun 11, 2005
    #1
    1. Advertising

  2. Daniel Amelang, Jun 12, 2005
    #2
    1. Advertising

  3. luke

    luke Guest

    thanks dan for the welcome! will try posting to the rails list in a few days
    if nothing surfaces. in case there's somewhere here that can help, i'm
    pretty sure it has to do with the environment variables on this computer. i
    remember the same thing happened when i tried installing ruby, i had to go
    through some steps to get it to the point where it could type 'ruby file.rb'
    into the command prompt and have it work. now the problem is getting the
    command prompt to recognise the 'gem' key word. but i'm not sure what to put
    in a new environment variable (i think that's the right term).



    "Daniel Amelang" <> wrote in message
    news:...
    Hi Luke, welcome!

    If you don't get a satisfactory answer here, try the rails mailing list:

    http://lists.rubyonrails.org/mailman/listinfo/rails

    Good luck!

    Dan
     
    luke, Jun 12, 2005
    #3
  4. On 6/11/05, luke <> wrote:
    >=20
    > when i open a command prompt and type in
    > gem install rails --remote i get a 'bad command
    > or file name' message. i'm using win98.


    gem (and Rails) use *.cmd extension batch files. These don't work on
    win98 apparently. Renaming them to *.bat by itself will not solve your
    problem either, and only you know the reason you want to run rails on
    win98. I mean, if Ruby does work, why shouldn't rails (and gem) too?

    When I tried this, I found that the gem installer uses some other
    win98 incompatible commands. I believe it was:
    <ruby_home>/lib/ruby/site_ruby/1.8/rubygems.rb on
    def find_home, line 326
    return "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}"
    and a couple of lines below
    File.expand_path("~")

    I rember "commenting out" both lines , and I believe I replaced the
    first one with just return "c:/", and things started sort-of working.

    Rails did install after that.But then trying to run it, I found it too
    used the same win98 incompatibilities, it even says "adapted from
    RubyGems"
    on <ruby>/lib/ruby/gems/1.8/gems/rails-0.12.0/lib/rails_generator/lookup.rb
    lines 31 & 33. I replaced them with return ... the absolute path to my
    working rails directory (where you'll be generating your app).

    That almost worked.

    I had a preexisting folder/directory there, and when I typed
    'rails install my_app', it did generate everything, only it put it all
    on that pre-existing folder, and not on one called 'my_app'. It didn't
    even create that one.

    Since I was tired by then, I didn't continue trying to "fix" rails, I
    simply copied all the generated files and directories to a backup
    "template" folder from which I copied them every time I wanted a new
    test rails app. Easier than generating I thought.

    And that did work.

    Oh. To save you some additional headaches I suppose, for Apache/MySQL
    I installed XAMPPLite
    http://www.apachefriends.org/en/xampp-windows.html

    But don't bother trying to get FastCGI working on win98. It won't.
    Yes, your app will be slow.

    Having said all that. See what you can do about working in (or
    upgrading to) a modern OS.

    I hope this helps

    C
     
    carlos tirado, Jun 12, 2005
    #4
  5. luke

    Jim Weirich Guest

    On Sunday 12 June 2005 11:29 am, carlos tirado wrote:
    > When I tried this, I found that the gem installer uses some other
    > win98 incompatible commands. I believe it was:
    > <ruby_home>/lib/ruby/site_ruby/1.8/rubygems.rb on
    > def find_home, line 326
    > return "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}"
    > and a couple of lines below
    > File.expand_path("~")


    We do try to make an attempt to "do what's right" on whatever platform we are
    running on. We only return the HOMEDRIVE/HOMEPATH string if both HOMEDRIVE
    and HOMEPATH exist.

    Here's the current find_home strategy:

    * Use ENV['HOME'] if it exists.
    * Use ENV['USERPROFILE'] if it exists.
    * Use "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}" if both exist.
    * Try to expand ~
    * If the expansion works, use that.
    * If the expansion failed, catch the error and return "C:/"
    on windows and "/" on non-windows.

    Any suggestions on improving this to work better for win98 would be
    appreciated.

    --
    -- Jim Weirich http://onestepback.org
    -----------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
     
    Jim Weirich, Jun 12, 2005
    #5
  6. luke

    Paul Guest

    It sounds to me like a PATH problem.
    If you type path at a dos prompt you should see ...c:\ruby\bin;.... in
    there somewhere. Add it to your path if it isn't there.
    Hope this helps.
    Paul.
     
    Paul, Jun 13, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. donkeyboy
    Replies:
    3
    Views:
    329
  2. AnthonyBaker
    Replies:
    8
    Views:
    110
    Stefan Arentz
    Feb 9, 2005
  3. James Britt

    Error installing Rails on Win2K

    James Britt, Feb 26, 2005, in forum: Ruby
    Replies:
    0
    Views:
    101
    James Britt
    Feb 26, 2005
  4. Mark
    Replies:
    4
    Views:
    144
    David Vallner
    Dec 16, 2006
  5. rgossen
    Replies:
    7
    Views:
    133
    Jeremy Hinegardner
    Nov 7, 2007
Loading...

Share This Page