How to install ruby? - ruby

I want to start learning ruby, but I don't know what kind of code editor to download,as I'm a beginner (GNU Compiler,windows 7 ,32 bits),can you give me a suggestion or a link,that doesn't contain viruses.
Thank you.

From my experience, if you really wanna learn ruby ​​as well, it will be much easier and more correct to install linux (ubuntu), since most ruby-devs uses linux-distributions. With linux it will be easy to install ruby and rails. If you talk about IDE, i suggest JetBrains RubyMine for start.

Related

Where can I compile my ruby code?

I started programming on ruby at codecademy but where can I compile my codes on doing a website?
When I was making some lessons on C I used codeblocks to run codes. I know any text editor can run a HTML code. So what about ruby?
Thank you.
I'll take a stab at answering the question that I think you're asking, but I'm not 100% sure here.
Ruby is an interpreted language (what does that mean? Not a whole lot nowadays. If you'd like a more in depth discussion on the distinction or lack thereof between interpreting vs compiling, read Jorg's comments below). To execute ruby code, you'll need to install ruby. Fortunately for you, this is freely available on any major platform. If you're on something unix-y (eg, linux or mac), I'd strongly recommend installing ruby via something like rvm or rbenv. If you're on windows, you can either go the cygwin route and pretend it's a unix-y environment, or there are prebuilt installers out there. Googling 'install ruby' should have some sites that can help you at or near the top of the search results.

how to start with ruby and install it? Which is better windows or VM? [duplicate]

This question already has answers here:
Limitations in running Ruby/Rails on windows
(16 answers)
Closed 9 years ago.
I have Windows 8 OS running on my machine and i also have Linux Ubuntu Virtual machine. I want to install ruby and work with it and I heard that windows doesn't support all ruby gems and Linux will be better for ruby. so do you think I should install ruby on windows or on my Virtual machine? which will be better? And help me with installing ruby on it. Also I want to know if there is any IDE as in eclipse for java better than a command prompt?
You may have some problems with gems on Windows, but in general those will be the gems that support Linux-only functionality. The same applies to a Linux installation: you may have problems with some gems there too, in particular with those that support Windows-only functionality.
Unlike Perl, where Windows compatability was bolted on after the language had established itself on Linux, Ruby is genuinely a cross-platform language, and there is no best choice of platform. Your only consideration should be, "what platform do I want to develop for?"
You may have some problems with gems on windows. Although they are mostly solveable, you'd better install x86 ruby interpreter.
First thing you should do is install ruby and devkit from this site. Full information about install process you may find here.
Well, you almost done. I think you will need some gems.
IDE is a hard question. I heard you mentioned eclipse. It is not only for java!:) If you are interested you may keep using eclipse. How? Read this article. It's about DLTK (Dynamic Languages Toolkit). But my choice is Aptana Studio. It is eclipse based IDE.
Why Aptana? It is free and provides eclipse-like user interface.
If you want to use debugger (I know you do) you should install debug-base and debug-ide gems.
There are also some proprietary IDEs like RubyMine (i really like it btw) or VS "plugin" Ruby in Steel
I have windows8, ruby 2.0 x86, Aptana IDE. Not everything but almost works fine.:)
Good luck!

How can I create debian package (*.deb) from ruby application written with qt4?

I found a lot of tutorials how to build application with Ruby and Qt, but i have no idea how anybody else will be able to run it! I am using Ubuntu 11.10, ruby 1.9.2 with rvm and:
rbqtapi -v output "QtRuby 2.0.5 using Qt-4.7.4"
P.S. I have no idea how to build *.deb, it will be my first desktop app, not web.
please have a look on http://shoesrb.com/ this is the best way I heard off for writing GUI apps.
Shoes has now not it's greatest time, but we put our best time to make it better, give it a try and someone will help you.
In case you are in need of assistance just ask as question on #shoes IRC channel on freenode servers.
If you're sold on QT, then you will need your users to install all the support libraries for QT (and anything else), then you can upload a rubygem to rubygems.org for your users to download.
Once, they've installed the support libraries, you'd only need to update your rubygem, which is fairly quick and easy for updates.
You may also wan to look at visualruby. It uses GTK. Then you'd install the GTK libraries instead of the QT ones.
http://www.visualruby.net
As far as .deb packages go, I tried to research the same thing with little success. The rubygems packaging system is designed to distribute ruby programs, so it is the best way to go. Also, you'll need to install different support libraries for different platforms. If you look at visualruby's install page, you can see how to install GTK for Linux and Windows.
Good Luck.

Is it possible to use jruby to write an applet or is it better to use iron ruby for silverlight?

If I wanted to dabble with ruby, would it be easier to write an applet in Jruby or a Silverlight XAP with iron ruby?
So far all I have is a vague idea that it might be possible.
Firstly, if you want to dabble with Ruby the language i'd just download the windows installer, plenty of resources in that.
If it's specifically applets you want to look at check out the recently released Gestalt, allows you to run Ruby in the browser (needs Silverlight) http://visitmix.com/labs/gestalt/getstarted/
I'd suggest this is one of those happy "it depends" things. Some questions to consider that may help you clarify your thinking:
Which environment do you know better?
What are your target environment(s)?
Are you happy to run a not-yet-1.0 version (IronRuby?)
Can you get both (either) to run in your development environment?
How much (any?) support/prior art available?
I have a nagging feeling this may need to go beyond "dabbling" ;-)
I'd go with jruby because:
Jruby is more mature than IronRuby
Applets are more mature than Silverlight
I like open source and hate MS (hate silverlight not IronRuby, respect for IR devs)
Java libs galore
But if u already know a lot about .NET mabe IronRuby
Not everyone can use Silverlight, Java seems to be available (and preinstalled) on more platforms at the moment, so I would go with JRuby.

Can Ruby be used for UI based Windows apps?

I'm sorry if this question is noob-ish but I'm not having much luck with Google. Can Ruby be used for UI based Windows apps? I'm not looking for a Rails app, just Ruby.
Thanks
You have couple of options.
Use Gtk Ruby which works on Windows as well (http://ruby-gnome2.sourceforge.jp/).
You can use WxRuby or Tk.
You can use JRuby and Swing.In fact there are high level libraries which can help you there, such as (http://monkeybars.rubyforge.org/)
Yes, but the experience will vary depending on how you hook up the UI. TK or gtk, wxRuby, ruby shoes (not sure how alive that one is right now), Qt (which is cool) and fox (aka fxRuby) are some of the options. If you like to hurt yourself, you can hook directly to Win32 libraries, but I doubt you'll want to.
Additionally, if you target the nascent IronRuby, you can use WinForms or WPF.
I also prefer wxRuby. It looks great, uses native components, yet is cross-platform. On the Ruby On Windows blog there is a great write-up of how to get started. It helped me a lot.
You bet. wxRuby is what I use, but others use GTK. wxRuby also works on Linux which is where I am writing a program, but it should suit your needs. You can install it using
gem install wxruby
You could check out wxRuby..
Depends what kind of Window app are you going to implement. If this is your own pet project, then definitely you can try WxRuby or GTK. There is no risk here.
However if this is going to be serious, commercial windows app then you have to think twice. It is really worth using Ruby? It is great language. I use it on daily basis. But for a Windows app, C# integration with the whole environment is hard to beat.
check out Shoooes!

Resources