Thursday, May 29, 2014

C extension support is not enabled. [pry-stack_explorer]

If you are using pry then you may looks for better pry debugger plugins . I faced the above issue when I used to install pry-stack_explorer. The complete error you can find here :

https://www.ruby-forum.com/topic/4832612#new

In my case I am using pry-nav and pry-stack_explorer combined to debug the code. Please follow the below steps to install the above plugins.

1) install jruby-1.7.8, Export the variable JRUBY_HOME and PATH
NOTE : explicitly export this variable as we are going to use it once.
export JRUBY_OPTS=-Xcext.enabled=true

2) install ruby-1.9
NOTE : Here we need ruby-1.9 only for libraries, So you can set the --prefix at the time of
configuration and install in you specified directory.

3) create directory structure in JRUBY_HOME/lib/native/include

4) create soft link in JRUBY_HOME/lib/native/include
 ln -s RUBY_HOME/include/ruby-1.9.1/ruby ruby

5) jruby -S gem install pry-nav

6) jruby -S gem install pry-stack_explorer

that's it .

Please suggests if any body have any better tricks or idea.


Thanks
-Khirod





Tuesday, May 20, 2014

cannot load Java class jline.console.ConsoleReader

Please follow the link for more information.

https://www.ruby-forum.com/topic/4816085#new

-Khirod

Friday, April 25, 2014

eclipse icon issue in ubuntu 12.04



  1. Install gnome-desktop if it is not there 
  2. Execute the command gnome-desktop-item-edit --create-new ~/Desktop
  3. click on the icon on left top side of the pop up box and set the for icon.xpm where eclipse edittor unzipped
  4. set the application path
Now it is ready to run eclipse from your Desktop luncher.



-Khirod

Saturday, February 15, 2014

ssh login without password

1)  Install ssh on both Host , we will take as client1 and client2 . Here client1 will login to client2 through ssh without password.

2)from client1:
cd ~
ssh-keygen -t rsa

Enter file in which to save the key (/home/client1/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/kshyama/.ssh/id_rsa.
Your public key has been saved in /home/kshyama/.ssh/id_rsa.pub.
The key fingerprint is:
da:0d:08:10:8c:e6:59:2d:b0:59:8d:cf:3f:bd:70:e6 kshyama@kshyama
The key's randomart image is:
+--[ RSA 2048]----+
| ooo..+          |
|....++ o         |
|o  oo +          |
| . . . +         |
|  .   . S .      |
|       o * +     |
|      . . B .    |
|           E     |
|                 |
+-----------------+


3)cat .ssh/id_rsa.pub | ssh client2@192.168.3.20 'cat >> .ssh/authorized_keys'

Now you are done. The ssh connection will not ask any password from client1 to client2

Tuesday, January 14, 2014

[JRUBY] NameError: uninitialized constant Net::SSH::Connection::Session::JavaLang

I have gone through the work around for this issue successfully , but still not sure if it is a bug of net/ssh gem

Error Details :

NameError: uninitialized constant Net::SSH::Connection::Session::JavaLang
   const_missing at org/jruby/RubyModule.java:2642


The above error encountered when my program tried to open a new channel session. It looks for JavaLang. I just simple add a module of JavaLang which use the package of java.lang and issue resolved. i.e.


require 'java'
require 'rubygems'
require 'net/ssh'


module JavaLang
  include_package "java.lang"
end

class Testing1
   
  def testConnection()
    Net::SSH.start("myhost","user_id", :password => "password" ) do |ssh|
       puts("Connection Established")
      ssh.open_channel do |channel|
        puts("SSH Channel opened successfully")
      end
    end
  end

end



-Khirod