How to fix strange symbols displayed in cmd - ruby-on-rails

Hello,
I'm using bash or cmd for Rails console.
I get this weird symbols like <-[1m.
In my tutorial I see the output fine (With spaces and color), and it's difficult to read it in my cmd...
Can you help me to display those special characters right?
Thanks!

Instead of using cmd, run rails and ruby through cygwin, it works better than cmd as cygwin is supposed to bring you a linux environnement on windows. When i tried to do rails on windows it was the most complete tool.
I insist on the fact that you should use a Linux VM to do rails on windows. If you install VMWare player on your windows, you will have a virtual machine running in vmware on your windows desktop. This machine will be connected to you network. I strongly advise you to use this solution, as you will encounter many problems using rails on windows.
I work on windows, and i have a Virtual Ubuntu always launched. My VM share the code via samba and i edit it with sublim text executed in windows. On my second screen i have my VM full screen that display multiple terminals.

Ok, I found this wonderful software https://code.google.com/p/conemu-maximus5/ and it did solve my problem :)

cmd.exe doesn't understand those color codes.
There is a project to make cmd understand them (and add other useful feaures) here. I do not use windows, so I cannot vouch for the quality of it.

Related

How do you run an .exe file on Docker?

I am currently trying to understand and learn Docker. I have an app, .exe file, and I would like to run it on either Linux or OSX by creating a Docker. I've searched online but I can't find anything allowing one to do that, and I don't know Docker well enough to try and improvise something. Is this possible? Would I have to use Boot2Docker? Could you please point me in the right direction? Thank you in advance any help is appreciated.
Docker allows you to isolate applications running on a host, it does not provide a different OS to run those applications on (with the exception of a the client products that include a Linux VM since Docker was originally a Linux only tool). If the application runs on Linux, it can typically run inside a container. If the application cannot run on Linux, then it will not run inside a Linux container.
An exe is a windows binary format. This binary format incompatible with Linux (unless you run it inside of an emulator or VM). I'm not aware of any easy way to accomplish your goal. If you want to run this binary, then skip Docker on Linux and install a Windows VM on your host.
As other answers have said, Docker doesn't emulate the entire Windows OS that you would need in order to run an executable 'exe' file. However, there's another tool that may do something similar to what you want: "Wine" app from WineHQ. An abbreviated summary from their site:
Wine is a compatibility layer capable of running Windows applications
on several operating systems, such as Linux and macOS.
Instead of simulating internal Windows logic like a virtual
machine or emulator, Wine translates Windows API calls
on-the-fly, eliminating the performance and memory penalties of
other methods and allowing you to cleanly integrate Windows
applications into your desktop.
(I don't work with nor for WineHQ, nor have I actually used it yet. I've only heard of it, and it seems like it might be a solution for running a Windows program inside of a light-weight container.)

Ruby 2 and Rails 3 running on windows server

I haven't tried yet, but I would like to have a good information background before begin.
I must run a Rails application on a Windows server (I think 2008),I know that there is other better solutions, but the client has this server's type.
I think that the problem can be solved in one of these four manners (maybe more?):
Running Apache/Ngnix as a service
Running directly from the OS
Running as virtualization
Running on a different partition (e.g. installing for example Ubuntu)
I have read tons of post but without finding a good solution (for Rails 3 and Ruby 2 I have find anything).
Which solution you suggest me? Which one is more stable and performant?
Any documentation is appreciated.
For ruby on rails its better to run it on linux than windows , on windows you will face a lot of problems like when you going to install gems , best thing is to install a vmware on your windows machine , then run Ubuntu or any linux distro you like through vmware, also you can check this question to know more

Creating a Ruby on Rails environment on Windows, in a VM Vagrant Box

Is Vagrant a good solutions for creating a Rails environment in windows?
I have a powerful Windows 8 64bit desktop. I recently did a project with RoR and fell in love with it. As I found out, installing RoR on windows is just bleh; so I created a dual boot to ubuntu. As a creative developer, I find it rather difficult to get any of the "creative" done in ubuntu because of the lack of my typical creative tools.
I read a bit about a tool called Vagrant; however, I'm still unsure if it meets my requirements: adobe suite, sublime text, git, rails, rails friendly OS(mac?/ubuntu)
Typical duties: edit an image in photoshop(windows), drop it to project assets in VM?
Typical duties: push/pull to git; ssh to VPS server?
Also, I hear you can install mac os in the VM do you think thats a good option? (because I want to try their new OS)
Installing osx in Vagrant is probably possible but it would likely be quite hard, and its not really what vagrant is designed for.
As for your other questions vagrant sounds like the perfect fit.
With Vagrant you could start up an ubuntu vm and get your rails setup going. Then you could just forward a port on your local machine to the vm and load the rails site as if it were running locally on your windows PC. A quick google gets this vagrant box that looks like it might work for you - https://github.com/amaia/rails-starter-box
To work with the site you can just share a folder between the vm and your local machine which will allow you to edit images and code with your windows apps (Photoshop, sublime) so you don't actually need to install these in the ubuntu vm at all, and can pretty much work as normal.
Git is much the same... I prefer to SSH into the vagrant box and use git on the command line in ubuntu but you can just as easily use gitbash or tortoisegit from windows in the repo folder... works just as well.
A good alternative is, https://github.com/fgrehm/ventriloquist
"Ventriloquist combines Vagrant and Docker to give developers the ability to configure portable and disposable development VMs with ease. It lowers the entry barrier of building a sane working environment without the need to learn tools like Puppet or Chef."

Delay when issuing any rails commands on windows vista

Everytime I run any rails command on my windows vista dev box there is always something like a 30 second delay before the command does anything. I don't have the firewall enabled and the virus protection is disabled. Any thoughts on what could be causing this?
Thanks
I can't comment on this specific issue, but I can say I had nothing but problems trying to run Rails on Windows in the past. That said, after trying Ubuntu and MacOs, I still prefer to use Windows as my primary UI. My solution is to run Ubuntu Server on a VM, and use a Samba file share to access dev files, with putty as my primary console interface. The linux command line is far more powerful, and is where the Rails ecosystem is really geared to be running.
VirtualBox: http://virtualbox.com
Ubuntu: http://ubuntu.com
Samba: http://www.samba.org/
Putty: http://www.chiark.greenend.org.uk/~sgtatham/putty/
With these tools, you can run your Rails stack in a nice linux server environment, and still enjoy the utility and functionality of the Windows GUI. (Although I'd recommend you move from Vista to 7)

Creating equivalent Rails workspaces on a Mac and a Linux box

I'm happy using TextMate and Terminal to develop in Ruby on Rail on Mac OS X.
I like being able to drag windows to resize them. I like having access to standard Mac shortcuts like command-X, etc. I like having the same look and feel as my other apps.
They both flow much more naturally than, say, PowerShell and Edit++ on Windows, which is why I've largely steered clear of using my Intel laptop for Rails.
But now I'm going to have to start swapping back and forth between my Mac and the Intel laptop so I'm thinking of installing Linux on the latter.
My question is in two parts:
(1) Can I install a terminal app and a text editor on Linux that flows just as naturally as TextMate and Terminal does on Mac OS X? Preferably, I'd want the same shortcuts etc on both platforms. (Except that the command key obviously gets mapped to control or whatever.)
(2) Failing that, I might move to a more Linux-like way of working on the Mac to create a situation where I'm working in the same way on both machines. To do this, is there an equivalent of MacVim on Linux, or should I just move to Vim on the Mac? What would be the parallel set-up (inc terminal app) on Linux?
I would recommend Aptana Studio 3, if you dare to switch to a full blown IDE.
(1) Aptana has a built in Terminal. Flowing as naturally as Terminal and TextMate? probably not.
(2) Aptana works on Linux, OS X and Windows, so everything should be the same.
Well if you plan to use your linux distro with gnome instead of kde, you probably should check gedit with gmate plugins, although is not like textmate power, it has a lot of it features. Another thing is that mac comes with zsh, so ur linux distro can also be installed with zsh and tuned to work with it, instead of the default gnome-terminal terminal.

Resources