Ruby on Vista problems

I have problems running the latest Ruby 1.8.6 on Windows Vista, and this
is (my guess) due to permission problems.

first of all… after writing the code in SciTE and pressing GO (build)
the command prompt will appear for a second and disappear.

So I open cmd.exe in administrator mode and run my code.rb from there,
and it would work… but then again…

the following code would give an error:

require’: no such file to load – yaml (LoadError)
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire’
from test_env.rb:1

I loved Ruby from first sight to the point that I started to hate VB
2005 Express. But VB Express 2005, is to my dissapointment much more
compatible and easier to use on Windows Vista than Ruby. So I beg of you
tell me of a clean and neat way to install Ruby on Vista without
encountering problems. Thanks, arto

================
require ’ yaml’ # Told you it was easy.

test_array = [’ Give Quiche A Chance’ ,
’ Mutants Out!’ ,
’ Chameleonic Life-Forms, No Thanks’ ]

Here’ s half of the magic:

test_string = test_array.to_yaml

You see? Kind of like “to_s”, and it is in fact a string,

but it’ s a YAML description of “test_array”.

filename = ’ RimmerTShirts.txt’
File.open filename, ’ w’ do |f|
f.write test_string
end
read_string = File.read filename

And the other half of the magic:

read_array = YAML::load read_string
puts(read_string == test_string)
puts(read_array == test_array )

Arto K. wrote:

require ’ yaml’ # Told you it was easy.

Remove the extra space before ‘y’ and it should work. You’re telling
Ruby to look for a module starting with a space.

Best regards,

Jari W.

Jari W. wrote:

Arto K. wrote:

require ’ yaml’ # Told you it was easy.

Remove the extra space before ‘y’ and it should work. You’re telling
Ruby to look for a module starting with a space.

Best regards,

Jari W.

thanks…

test_env.rb:15:in initialize': illegal access mode w (ArgumentError) from test_env.rb:15:inopen’
from test_env.rb:15

On Nov 25, 5:52 pm, Arto K. [email protected] wrote:

oops… it was the same mistake !!! :slight_smile: works now!

Yeah, you keep putting a empty (white) space in all your strings…
the filename, the require, and even the ‘mode’ in which the file is
opened.

Just to be safe, don’t use spaced filenames :slight_smile:

oops… it was the same mistake !!! :slight_smile: works now!

Arto K. wrote:

I have problems running the latest Ruby 1.8.6 on Windows Vista, and this
is (my guess) due to permission problems.

Maybe. I’ve been using Ruby on Vista Home for about 2 months now. Poor
Ruby support is not among my many reasons to dislike Vista.

OTOH, I disabled (as best I could) the annoying Please Ask Permission
stuff early on.

I loved Ruby from first sight to the point that I started to hate VB
2005 Express. But VB Express 2005, is to my dissapointment much more
compatible and easier to use on Windows Vista than Ruby.

Well, what you’re experiencing is perhaps Scite+Ruby on Vista.

I’d suggest getting comfortable with doing things at the command line
(even if you prefer a IDE-like editor).

So I beg of you
tell me of a clean and neat way to install Ruby on Vista without
encountering problems. Thanks, arto

================
require ’ yaml’ # Told you it was easy.

-----------^ misplaced whitespace!

but it’ s a YAML description of “test_array”.

filename = ’ RimmerTShirts.txt’

--------------^ misplaced whitespace?

File.open filename, ’ w’ do |f|

-----------------------^ misplaced whitespace!

Are you cutting and pasting from someplace that is padding the clipboard
text? You have a lot of quoted strings with a leading space.


James B.

“If you don’t write it down, it never happened.”

  • (Unknown)

Are you cutting and pasting from someplace that is padding the clipboard
text? You have a lot of quoted strings with a leading space.

Yes, actually was copy pasting from a book by Chris P., it didn’t
occur to me that it would paste incorrectly… anyway thanks for telling
me guys.

Or, if you’re used to an IDE, download and try Netbeans. I use NB6-rc2
with the native Ruby interpreter and it’s a great development
environment! The active syntax highlighter is fantastic.

I’ve tried netBeans really cool interface but it seemed to me that
NetBeans is encouraging JRuby rather than Ruby… so what do you think?
Is it better to learn JRuby or Ruby? And which one is better for windows
applications and creating Windows Forms, buttons…etc?

thanks in advance,
arto

James B. wrote:

Well, what you’re experiencing is perhaps Scite+Ruby on Vista.

I’d suggest getting comfortable with doing things at the command line
(even if you prefer a IDE-like editor).

Or, if you’re used to an IDE, download and try Netbeans. I use NB6-rc2
with the native Ruby interpreter and it’s a great development
environment! The active syntax highlighter is fantastic.

Best regards,

Jari W.

OTOH, I disabled (as best I could) the annoying Please Ask Permission
stuff early on.

I am curious… Windows User Account Control is one of Vista’s main
security features (supposedly it does a good job), if you disabled that
then you’re off with XP Professional… don’t you think so?

You may have something set up wrong though I can’t tell you what
exactly.
I’ve been using ruby for all kinds of things including the net:ftp,
net:html and some others without any problem.
So it is feasible to do. Also no problem with majik and some of the
other jems either
I’ve not had any problem with SciTE either.

Wish you luck.

Tom R.

I’m using vista and the latest windows install of ruby.Arto K.

Arto K. wrote:

Or, if you’re used to an IDE, download and try Netbeans. I use NB6-rc2
with the native Ruby interpreter and it’s a great development
environment! The active syntax highlighter is fantastic.

I’ve tried netBeans really cool interface but it seemed to me that
NetBeans is encouraging JRuby rather than Ruby… so what do you think?
Is it better to learn JRuby or Ruby? And which one is better for windows
applications and creating Windows Forms, buttons…etc?

Although the default setting after installing NB is set to JRuby, it’s
just to change the setting if you want to use native Ruby. Native Ruby
is fully supported. In recent builds, you can also choose different
interpreters for different projects if you want.

If you want to create Windows apps, it’s more a matter of selecting the
windowing toolkit suitable for your needs. I’m using wxRuby, but there
are many others. Test a couple of gems and use the one you like the
best.

Best regards,

Jari W.