How to update Ruby 2.0 to the latest version of Ruby on Mac OS X Yosemite?

Hi,

Mac OS X Yosemite comes included with Ruby 2.0. But when you are working with the latest version of Rails[4.2], you might be in need of the latest version of Ruby [2.2] to have better performance. So, how do you update Ruby? There is a simple solution for this is to use Ruby Version Manager (RVM), which is a standard for upgrading ruby on OSX.

To do this. Open your terminal and run

\curl -L https://get.rvm.io | bash -s stable –ruby

When this is complete, you need to restart your terminal for the rvm to work.

Now, run rvm list known 

This shows the list of versions of the ruby.

Now, run rvm install ruby-2.2.0

If you type ruby -v in the terminal, it still shows you ruby 2.0.

To use the latest installed version. Run rvm use ruby-2.2.0

Now, when you look at the version, it shows you the following:

ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]

There you go, you have the latest version of ruby now in use.

Cheers,

SZ

Fix to the Error installing Rails on Mac OS X !

Hi,

I was trying to install Rails on my mac by using the command:

sudo gem install rails

But it threw me the following error

ERROR:  Error installing rails:

ERROR: Failed to build gem native extension.

This happens if I haven’t installed the Xcode Command Line Tools properly. To do that

Run xcode-select –install in terminal

This would install the Xcode command line tools. Thats it, you are good to go.

Re run the sudo gem install rails in the terminal and it will install the rails.

To verify if the rails is installed properly. Run rails -v in terminal.

This shows us the version of the rails installed on the machine.

Cheers,

SZ

Programming Style!

I was learning Ruby and I stumbled upon this short note on the programming style. I loved it. The author Huw in “The Book of Ruby” says that “A good programming style has nothing to do with the naming conventions and everything to do with good code structure and clarity.” He also says with his experience that the most important characteristics of well-written code are clarity and lack of ambiguity. Code that is easy to understand and easy to debug is also likely to be easier to maintain.

It makes perfect sense and I loved it, hence I posted it. I am thinking to do this more often as I strongly believe if I write about something I learn, it would retain in my mind for a longer time.

Installing Windows 8.1 on VMware Fusion on Mac

Hi,

This post demonstrates how to install Windows on your VMware Fusion on Mac. Frankly speaking, it’s a piece of cake if you do everything right. I did good amount of research on the internet reading various posts and reviews on the performance issues one might have by installing windows on virtual machine.

I have even personally experienced the Windows 8.1 installed using the Boot Camp Assistant on a separate partition. One thing is clear, personally I felt dual booting was a pain. I didn’t like it at all. I have to install all the software applications again in the other partition. I can’t access files from Mac. I can’t utilize my trackpad to the fullest. I ran out of memory in a couple days after installing Visual Studio and I had only 7 GB of space left. I allocated 60 GB for Windows partition because I only have 256 GB Flash drive. I couldn’t update Visual Studio further and I couldn’t install SQL server on the partition because of low disk space. It was terrible. So I got rid of it. One more thing, I spent over an hour to install windows using the boot camp.  One might be thinking, why did I install windows using boot camp instead of installing it on virtual machine. Because, I thought there would be performance issues and I was trolled for doing that.

Okay coming to the configuration of my machine.

I have a MacBook Pro Retina 15 inch Mid 2014 (latest) currently running OS X Yosemite Version 10.10.2

Processor: 2.2 GHz Intel Core i7

Memory: 16 GB  1600 MHz DDR3

Graphics: Intel Iris Pro 1536 MB

Storage: 256 GB Flash

So even though you have an i5 processor with 8 GB of RAM, its good to go.

This post assumes that you have VMware Fusion already installed on your machine. If you don’t have it, download and install it. As I am a student enrolled at a university. I got it for freeeeeeeeeee!! Good stuff!! Anyways, following are the steps to be followed to install Windows 8.1 on your VMware Fusion on a Mac Machine.

Step 1: Fire up VMware Fusion and click on “+” and select “New“.

Screen 1

 Step 2: In the installation method. Select the “Install from disc or image” option and click on continue.

Screen 2

Step 3: Click on “Use another disc or disc imageScreen 3 Step 4: Select the iso image of Windows 8.1 from the file chooser. Once you select it, it appears as the following. Click on continue.

Screen 4

 Step 5: Check Easy Install and give your details and enter the Windows registration key.

Screen 5

Step 6: Select “More Seamless

Screen 6

Step 7:  Here the Virtual Machine automatically assigns the memory, to configure it, you should click on “Customize Settings” and save the virtual machine.

Screen 7

Step 8: The VMware fires up as soon as you save the virtual machine as below: Click on the “Processors and Memory” option in the System Settings.

Screen 8

Step 9: Select “processor cores” as following and allocate the memory depending on your machine’s memory. Also, 4 GB is recommended as Visual Studio and other developer tools need minimum of 4 GB RAM as a requirement. So, beware of that.

Screen 9

Step 10: After you close the settings page. Click on the play button on the screen which looks like the following. As soon as you do it, the windows setup starts.

Screen 10

Step 11: Setup screen

Screen 11

Step 12: It hardly took 4 to 5 minutes for the installation to be completed. I was really amazed at the speed of installation.

Screen 12

I skipped the McAfee antivirus installation. Now, you can simply login with the password which you have given on the easy installation screen.

Screen 13

And there you go. You have your Windows 8.1 on your VM on Mac. If you want to install Visual Studio. Just download the PowerISO on your windows VM and extract the files from its image and install. As simple as that.

I found this link very interesting on the performance of visual studio on the VMware Fusion. Do check it out.

Have fun.

Cheers,

SZ

Removing Windows from Mac using Boot Camp

Hi,

This is a short post demonstrating the complete removal of windows from Mac which has been installed using Boot Camp native application. Once you remove Windows, the bootcamp automatically restores the space and reverts it to a single OS X partition like before.

Step 1: Open the bootcamp application by navigating to Applications -> Utilities -> Boot Camp Assistant.

Boot Camp Assistant

Step 2:  Click on Continue

Screen 1

Step 3: Check Remove Windows 7 or later version and click Continue

Screen 2

Step 4: If you haven’t backed up your files on Windows partition. Please do it. Because continuing on this step would completely remove all the files on the windows partition and cannot be recovered.

Click Restore to continue the process.

Screen 3

Step 5: Restoration of Partition starts

Screen 4

Step 6: Done. The Windows partition is removed successfully.

Screen 5

You can check the disk size after quitting this application.

Cheers

SZ

How to download and install iOS 8 without deleting any of your data?

If you have tried downloading iOS 8 on your iPhone or iPad which is filled with applications, you might run into a problem. That’s because iOS 8 will prompt you saying that it needs 5 giga bytes of space to download and install the new OS. Though the size of the update is 987MB as shown on iPad and 1.5 GB on iTunes, you have to clear up the space to download and install.

So, how do you make 5 Gigabytes of space? Do you delete all your pictures, videos, or game apps? That is one way to do but I suggest not to do that. Because it’s crazyyy. There is other way around. Just connect your iPad/iPhone to your Mac/PC. Back up your device and then click on “Check for update” button in the iTunes and next when it shows iOS8 is available to download and install. Click on that and you are done.

Happy installing iOS 8 :D