Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

ruby-1.9.2

Neither ruby and nor irb can load .rb file in current directory

April 12, 2024 by Tarik

None of these worked for me, but this did: irb -I . >require ‘file’ => true

Categories ruby Tags import, irb, require, ruby, ruby-1.9.2 Leave a comment

Thread Safety: Class Variables in Ruby

May 8, 2023 by Tarik

Examples 2 and 3 are exactly the same. Modules and classes are also objects, and defining a singleton method on a object actually defines it on its singleton class. With that said, and since you have already established instance variable access is thread safe, examples 2 and 3 are thread safe. Example 1 should also … Read more

Categories ruby Tags metaprogramming, multithreading, ruby, ruby-1.9.2, thread-safety Leave a comment

How to set default Ruby version with RVM?

April 16, 2023 by Tarik

If you put the RVM source line in your bashrc (in order to ensure that non-interactive shells have access to RVM), you will need to source .bashrc from your .bash_profile with the following as the last lines in your .bash_profile if [ -f “$HOME/.bashrc” ]; then source $HOME/.bashrc fi This pre-supposes that you have [[ … Read more

Categories ruby-on-rails Tags ruby, ruby-1.9.2, ruby-on-rails, rvm Leave a comment

Invalid gemspec because of the date format in specification

January 23, 2023 by Tarik

Here is the way I fix the “invalid date format in specification” error: 1.) Go to the specifications folder located at: /usr/local/lib/ruby/gems/1.8/specifications/ 2.) Find the spec that is causing the problem. 3.) Change s.date = %q{2011-05-21 00:00:00.000000000Z} to s.date = %q{2011-05-21} That’s a WIN for me! Good Luck

Categories rubygems Tags bundler, ruby-1.9, ruby-1.9.2, rubygems Leave a comment

Get list of a class’ instance methods

December 30, 2022 by Tarik

TestClass.methods(false) to get only methods that belong to that class only. TestClass.instance_methods(false) would return the methods from your given example (since they are instance methods of TestClass).

Categories ruby Tags reflection, ruby, ruby-1.9.2 Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa