Posts

Showing posts from October, 2010

LINUX commands

1)To list all files
ls

2)To list files with file size
ls -lh

3) list files, including the hidden and files with (.) dot extensions
ls -larth

4)To go to the end of file
tail -f /root/

5i)To edit/create a crontab
crontab -e

5ii)If the cron job is in different directory add the following in the shell script which

the cron calls
PATH
LD_LIBRARY_PATH

6)To go to the top/end of a long file, type the following while the file is open
1G

7)To change read/write/execute permission of the file
chmod

8)To call website from linux OS
curl`http://abc.com`

9)In shell scripts there should be no spaces between variables and = sign

10)To replace a word, go to the beginning of the word and type
CW

11)To delete a line, press
ESC-key+X

12) If you have the vim editor installed, can try out the following
dd --> to delete a line
yy --> to copy a line
p --> to paste the above
Shift6 --> to go to the beginning of a line
$      --> to go to the end of file

13) To find details of a definite process runnin…

Uninitialized constant Win32 (NameError)-cucumber

I confronted the error whenever I was trying to run, for my new rails 3.0 app in Windows 7
>> rake cucumber
The error looked like
>>uninitialized constant Win32 (NameError)

Solved by installing the following gem, adding the line in the gemfile

gem 'win32console'

Go to your app directory and execute  >> bundle

That's it !! I am able to run the cucmber now :-)

Uninitialized constant RbReadline::Encoding error while running rake for rails 3.0.0 with ruby 1.8.7 app

Got the above error whenever I was executing rake for my new rails 3.0.0 app in Windows 7.

Comment out the following lines from the rbreadline.rb file under C:\Ruby187\lib\ruby\site_ruby\1.8

This is really a huge file, opening in Word and then adding line numbers in the document may help you in commenting line number 4404. Though it  may sound silly but I am adding the steps to add the line numbers  in word document too.

File -> Page Setup -> Layouts -> Click on line numbers --> continuous

Line no 4404

and the following one

if defined? ''.getbyte
      @encoding = "X"      # ruby 1.9.x or greater
      # @encoding_name = Encoding.default_external.to_s
   end

For details the following URLs are really helpful
http://trbhoang.blogspot.com/2010/05/issue-with-rspec-on-windows.html
http://tom.net.nz/2010/09/installing-diaspora-on-windows/

Unable to Download gem with native extensions with Ruby 1.8.7 and Rails 3.0

A couple of days back I have installed Ruby 1.8.7 for working with Rails3.0.0 To my surprise whenever I was executing the any of the gem installation commands with native extensions, it was failing. Then I found the following stuff after searching quite a bit.
Following URL gives the details or else you can look at the bullet-ed points below and execute them in order

1) Uninstall any DevKit previously installed in your system. Control Panel\All Control Panel Items\Programs and Features --> uninstall Devkit
2) Get the DevKit from the following url http://rubyinstaller.org/downloads/
3) Download the exe file to a local folder like D:/DevKit
4) Go inside the folder from the command prompt and execute the following commands
i) ruby dk.rb init --> this will create the config.yml file
ii) ruby dk.rb install
iii) devkitvars.bat  --->; This will add in the PATH variable
5) Install the gems
gem install devise --platform=ruby
gem install devise_rpx_connectable --platform=ruby
6) or yo…