Is this statically bound?
Say that I have a C program and it has this line:int a = 12;Is the value of 12 bound to 'a' during compile time? Or is the value placed into memory during run time when the scope of the program hits...
View ArticleFrozenError in colored2 gem while running pod install in CocoaPods 1.16.2
I'm encountering a FrozenError when trying to run pod install with CocoaPods 1.16.2. The error occurs during the execution of the colored2 gem, specifically in the ascii_decorator.rb file. The error...
View ArticleHow to run ruby code in a jupyter notebook?
I have installed Jupyter with conda, and iruby according to instructions here https://github.com/SciRuby/iruby, and there are 2 ways to start jupyter:iruby notebook (given in the README)In VSCode with...
View ArticleTake all items with enumerable#take
How can I Enumerable#take all the things?arr = [1, 2, 3]# Worksarr.take(1)# Gives RangeError: float Inf out of range of integerarr.take(Float::INFINITY)# Gives RangeError: float Inf out of range of...
View ArticleIf using Ruby with Net/HTTP, how to monitor its traffic using Fiddler on...
I usually use Fiddler to monitor HTTP request and response, but if it is a Ruby script using Net/HTTP, all the request and response won't show up in Fiddler.Is there a way to see all the request and...
View ArticleHow to define a simple global variable in an rspec test that can be accesed...
I cant figure out how to use a simple global variable in an rspec test. It seems like such a trivial feature but after much goggleing I havent been able to find a solution. I want a variable that can...
View ArticleRVM Ruby 3.1.4 fails to install on macOS Sonoma due to perl5.18
I'm trying to install Ruby 3.1.4 version on Sonoma 14.4 with rvm and got this error:Error running '/Users/username/.rvm/src/ruby-3.1.4/autogen.sh', please read...
View ArticleRails activerecord-import not work with unique key
modelclass User < ApplicationRecord validates :name, uniqueness: trueendschemacreate_table 'users', force: :cascade, charset: 'utf8mb4', collation: 'utf8mb4_0900_ai_ci' do |t| t.string 'name'...
View Articletelegram webhooks not working after release on production [closed]
I have a Telegram bot integrated with my Rails application, and I’ve noticed an issue where, sometimes after deploying a new release to production, my Telegram bot stops working—even when the...
View Articleruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load...
I am trying to run this below code, then I got code error:ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- selenium-webdriver (LoadError)I am not able to find...
View Articlebundle gem: rspec says 'No examples found'
I am in the middle of porting part of a ruby on rails project into a gem. I have used bundle gem to create the new gem directory. For the lib and spec directories, the gem's project layout looks like...
View ArticleCan't run sudo pod install after updating to cocoapods 0.32.1 with error "You...
I found an issue when running sudo pod install command after updating it to latest version 0.32.1. Earlier it was working very fine.When I tried to do pod install with older cocoapods, it asked me to...
View ArticleInconsistent ruby case statement behavior with trailing commas and assignments
Stumbled into a weird error, and I'm curious if anyone can explain this inconsistency or if I should send this to the ruby team as a proper bug. I'm currently using ruby 3.2.2.Take this script as a...
View ArticleTrouble Installing Specific Version of Ruby (OpenSSL Issue)
I have a 2020 Intel Mac running Sonoma. I'm working on a web app project that is running on Rails. For the last few months, I've had the same issue no matter what I try. I follow the Rails instructions...
View Article"for" vs "each" in Ruby
I just had a quick question regarding loops in Ruby. Is there a difference between these two ways of iterating through a collection?# way 1@collection.each do |item| # do whateverend# way 2for item in...
View ArticleFind where a specific Ruby version is installed
On Mac, I used to have rbenv as Ruby version manager but recently switched to asdf. I want to create a Ruby on Rails 7.0.4 but it uses an outdated version and I'd like to locate it.$ rails new...
View ArticleRuby active_record-acts_as gem issue with joining for child and parent class
class Product < ActiveRecord::Base actable as: :as_productendclass Car < ActiveRecord::Base acts_as :product, as: :as_productendclass Truck < ActiveRecord::Base acts_as :product, as:...
View ArticleRuby namespace flattening gotchas?
I must use a ruby library that looks like it was written by a java developer because the namespaces are so looooooonngg. And I have to use a lot of the classes in the namespaces.I would like to make my...
View ArticleRails database structure for multiple Projects in productive [closed]
we are currently on GKE and have a HA database for each rails project (service). But now we want to hand over GKE to Kamal. And there I was wondering if it is more usefuller to use maybe 3 databases...
View ArticleRails Global Variable- Update on each request from API
I have used GRAPE gem for creating API end point. For simple use case, let us consider that when my web service is hit, I hit a another third party REST API and I fetch few values and assign these...
View Article