development

Assertion failed: (!STR_EMBED_P(shared)), function str_new_frozen, file string.c, line 1075.

Solution If you workflow has Docker container, please stop the containers. Check with $docker ps and verify that all containers are in exited state. Set the right Ruby version. Find out from the project repo Makefile, build scripts. Update the bundler to same version as of Ruby. Reference https://bugs.ruby-lang.org/issues/11946 https://github.com/rbenv/rbenv https://philna.sh/blog/2017/03/22/always-install-bundler-alongside-ruby-with-rbenv/

Read more
development

Ruby Class Members: Getter & Setter

The simplest example of read_attr, write_attr in a class. class Person attr_reader :name, :age attr_writer :name, :age # creates the setter methods def initialize(name) [@name](http://twitter.com/name) = name end endmike = Person.new(‘Mike’) mike.age = 20 # calling setter method mike.age # calling getter method, returns 20 Reference The example is verbatim from an easy to follow […]

Read more
development

Understanding Ruby Symbols

Ruby is an interpreted language. It is dynamically typed and uses a new memory for a variable. A variable has a name and a value. Symbols are an optimized variable that holds single instance of memory. It is good for variables that assume the same values across the program such as hash table keys. h […]

Read more
development

One More Reason to Avoid Ruby Language

Ruby is type unsafe language but it goes a step further and avoids checking dynamically too. Consider this code x = :abc if x == ‘abc’ puts “Symbol and String are two different classes” else puts x.class, ‘abc’.class end # puts can print a symbol and string alike. puts x My Complaints I’m new to […]

Read more