[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

newb) installing rails

luke

6/11/2005 5:19:00 AM



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


5 Answers

Daniel Amelang

6/12/2005 2:58:00 AM

0

Hi Luke, welcome!

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

http://lists.rubyonrails.org/mailman/list...

Good luck!

Dan


luke

6/12/2005 8:33:00 AM

0

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" <daniel.amelang@gmail.com> wrote in message
news:a65ae5c905061119572c0b7bad@mail.gmail.com...
Hi Luke, welcome!

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

http://lists.rubyonrails.org/mailman/list...

Good luck!

Dan



tirado.carlos

6/12/2005 3:30:00 PM

0

On 6/11/05, luke <lduncalfe@eml.nope> wrote:
>
> 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-wi...

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


Jim Weirich

6/12/2005 7:54:00 PM

0

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 jim@weirichhouse.org http://onest...
-----------------------------------------------------------------
"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)


Paul

6/13/2005 11:46:00 AM

0

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.