How can I specify to the VSCode ruby-lsp extension to use docker container?
I have rvm installed on my MacBook where I am developing a Ruby on Rails app that is in a Docker Compose environment. I want VSCode's ruby-lsp extension to use the installation of ruby in my container...
View ArticleRails api 8 ActionView stubbornly trying to render HTML/ERB
I managed to use devise and devise-jwt to have a session of sign up. However, my success is hidden under layers of errors of ActionView despite I never explicitly stated I wanted to run HTML/ERBLink I...
View ArticleHow to fix "no implicit conversion of String into Hash"
I am trying to run a test with RSpec but it always returns the same error:DevicesController#update when user is a manager must update any device Failure/Error: put device_path device_id, params:...
View ArticleNginx and Unicorn not working due to unicorn.sock file error
I am setting up VPS for the first time on upcloud. I am using unicorn 5.5.5 with Nginx. Rails 4.2.8 and ruby 2.4.2. My Nginx service runs fine. Doesn't show any error. Whenever I start unicorn service...
View ArticleRails 4.2 app doesn't respond after 2-3 hours IDLE time on virtual private...
I am trying to setup my virtual private server on upcloud. I am using PUMA 4.3 with ruby 2.4.2 and rails 4.2.8. My Puma Configurations are threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)threads...
View ArticleAn error occurred while installing psych (5.1.2), and Bundler cannot continue
An error occurred while installing psych (5.1.2), and Bundler cannot continue.In Gemfile: debug was resolved to 1.9.2, which depends on irb was resolved to 1.13.1, which depends on rdoc was resolved to...
View ArticleHow can I correctly use the FFI Ruby library to build a simple Window by...
I've been trying to use Ruby's FFI to make a project that needs Win32 APIs. I can't get to see the Window at all. I get MessageBox to run successfully but no luck making an empty Window. My guess is...
View ArticleHow to skip ALL Callbacks while creating/updating an ActiveRecord in rails
I need a simple way to skip validations and callbacks while updating an active record.I am running the following code:Student.find_or_create_by(id: data['id']).update(data)where data is the hash having...
View ArticleRuby, Difference between exec, system and %x() or Backticks
What is the difference between the following Ruby methods?exec, system and %x() or BackticksI know they are used to execute terminal commands programmatically via Ruby, but I'd like to know why there...
View ArticleHow to sum repetitions of a value and add it in two values of a key in Ruby?
Im trying to to create a hash with one key per each type of extension on a directory. To every key I would like to add two values: number of times that extension is repeated and total size of all the...
View ArticleHow to create array with hours in ruby
I need to create the following Array:array_time = [00:00:00, 00:00:01, ..., 23:59:59]Is there a way to generate this type of hash with all hours of the day in ruby?Because then I will need to create...
View ArticleInstalling gdbm in a Oracle Linux 9 Slim container using microdnf returning...
I'm building Ruby from source as we need a specific version that's unavailable from the repositories (3.2.2). The base image is Oracle Linux Slim, so we're using microdnf.I'm using ruby-env/ruby-build...
View ArticleWhy is my edit worker page show different worker details
i currently doing a worker edit page. Normally when we click on a worker then click edit page, in the edit form will show this worker info like name, but now my edit page show different worker info (I...
View ArticleRuby Gem for generation of unique anD not changeable URL
Can someone suggest me the gem in ruby that generates URL which will be unique and not changeable for each individual .
View ArticleHow to install Wkhtmltopdf in Amazon Linux 2023?
I am upgrading my servers to Amazon Linux 2023 from AL2. My application needs wkhtmltopdf and now while trying to install it I see that is not officially released on my specific OS version. I have...
View ArticleRuby on Rails 8 API not allowing mobile phone connection
My ruby on rails 8 API works with postman, but I get 401 unauthorized access when trying to connect through android studio avd. I tried to stick to this link...
View ArticleRuby unary tilde (`~`) method
I was goofing around in a pry REPL and found some very interesting behavior: the tilde method.It appears Ruby syntax has a built-in literal unary operator, ~, just sitting around.This means ~Object.new...
View ArticlePaperclip gem Rails [6.1] : migration error wrong number of arguments (given...
Im trying to install paperclip gem on my rails app and I had 3 problems in succession and I would like to point out to them, it may be related to the last problem :1- I coulden't install the paperclip...
View ArticleGtk TextView - how to change width of cursor?
I'm using a Gtk TextView in a small Ruby program. The text cursor is a vertical bar, only 1 pixel wide. I have changed its colour to red but it is still barely visible. Can it be made wider?require...
View ArticleRb HASH[row.headers().zip(row.fields) is outputting incorrect data when it...
Code :def extract_from_csv(filepath) l={} CSV.foreach(filepath, :headers => true, :header_converters => :symbol, :converters => :all) do |row| c0 = row.fields[0] c1 = row.fields[1]...
View Article