a Digital Ocean Alternative

I have always recommended Digital Ocean to host Ruby on Rails.

But I have recently come to know about Vexxhost, a Canadian host which has partnered with Cloud66. They offer same low rates of Digital Ocean.

Here are Vexxhost pricing as per January 2014

Image

And here is the pricing of Digital Ocean as per same date

Image

I have not tried Vexxhost yet, but heard and read good reviews about. Their servers are currently in Canada only, while Digital Ocean has servers in NY, Amsterdam and Singapore.

So if for some reason you are looking for an alternative to Digital Ocean hosting and don’t want to pay more, Vexxhost seems to be your current best bet.

Advertisements

Upgrading to Rails 4 for these who used RailsInstaller

RailsInstaller still has not updated to Rails 4 in its bundle. But you can do the upgrade yourself.

It worked well for me, follow this screencast and you will be safe.

http://railscasts.com/episodes/415-upgrading-to-rails-4

Have Ruby on Rails Installed on Windows the Best Way

This is a complete step by step instructions with minimal explanations, on how to set up your Windows machine for starting building your RoR application in the most efficient and professional way.

Most of this is inspired from the Michael Hurtl most recommended Rails book 

1. Download and install RailsInsaller

2. Download and install Console 2

3. Download and install Sublime Text 2

4. Download and install Herkou Toolbelt

5. Open Console 2

6. Navigate through cd commands to a folder where you want your app folder to be created

7. Run rails new applicationname (will create the application directory with all rails default sub-directories and files)

8. Open gemfile with Sublime Text 2 and change as per your required gems. I found the gemfile used by Rails tutorial book is perfect to use in every application, then add gems when you need later. But make sure you:
  – remove rb-fsevent, growl, rb-inotify, libontify
  – add 

gem ‘rb-fchange’, ‘0.0.5’
gem ‘rb-notifu’, ‘0.0.4’
gem ‘win32console’, ‘1.3.0’

Google the pages of these gems to check their latest version and change the version number accordingly

9. Navigate with Console 2 to your newly created app folder and run bundle install

10. Run rails s

Congratulations you now have rails server running with some beautiful essential gems.

11. git init

12. git add .

13. git commit -m “Initial commit”

14. Create git account on github

15. git remote add origin https://github.com/%5Busernane%5D/%5Brepositaryname%5D.git

16. git push -u origin master

Congratulations you have just set up Git to work smoothly with your app.

17. Create a heroku account

18. Run heroku login on console 2

19. heroku create

20. git push heroku master

Congratulations you have hosted your app on Heroku.

The most recommended testing environment is rspec, and here is the best way to install it with the best supporting gems and options.

21. In console 2, run rails generate rspec:install

22. bundle exec guard init rspec (guard gem for autotesting)

23. change content of guardfile to the one used in the tutorial

24. bundle exec spork –bootstrap (spork gem for speeding up tests)

25. Change content of spec/spec_helper.rb to the one used in the tutorial

26. Change content of .rspec file to 

--colour
--drb

27. bundle exec guard init spork (to tell rails to use spork with guard)

28. add :cli => ‘–drb’ argument to guard ‘rspec’ line in guardfile

29. In sublime text 2 go to preference -> Package Control and select install package find  rubytest and have it installed.

30. preference -> Package Settings->RubyTest->Settings – User add bundle exec before any rspec you find

Congratulations you now have rspec testing framewrok installed with the best supporting gems to autotest, notify, and speed things up. You can also now run tests from Sublime Text 2 itself.

In thirty steps you now have everything ready for the best development environment on Windows for any serious application development.Image

How to Insert Code Snippets in a WordPress Post?

While am writing this blog, I had the need to display code snippets in a different format than the usual writing.

I found this support article from WordPress! The good news is that WordPress understands programming languages, I mean it color-highlights text based on every language syntex!! And it knows a lot, lots of programming languages!

You could also use <pre></pre> for simple code snippets, it will use a fixed width formatting.

Of course make sure you are on the text table of the body, not the visual.

so now from one I will be using very frequently these :

[sourcecode language=”ruby”]
my code here
[/sourcecode]

WordPress Logo 中文: WordPress Logo

Heroku

Heroku has become the standard of Ruby on Rails hosting.

It is so  easy that it requires a very few simple steps:

Create an account at Heroku. And yes it is free.

  • Install the Heroku gem to your ruby on rails project by command:
    $ gem install heroku
  • Add your key to Heroku
    $ heroku keys:add
  • create a subdomian at heroku
    $ heroku create --stack cedar
  • use git to push your project:
    $ git push heroku master

    Image representing Heroku as depicted in Crunc...

Ruby on Rails installation on Windows

It seems not to be very common to see Ruby on Rails working on a Windows environment.

But as long as I am still a beginner, I won’t change my OS…

If you need to install Ruby on Rails on Windows. Don’t get lost. One simple and easy step:

Download http://railsinstaller.org then install it.

Ruby on Rails installation on Windows

It seems not to be very common to see Ruby on Rails working on a Windows environment.

But as long as I am still a beginner, I won’t change my OS…

If you need to install Ruby on Rails on Windows. Don’t get lost. One simple and easy step:

Download http://railsinstaller.org then install it.