Is assignment in a conditional clause good ruby style?
In order to write more concisely, rather than do this:test_value = method_call_that_might_return_nil()if test_value do_something_with test_valueendI've been assigning in the conditional:if test_value =...
View ArticleUnable to use rename in neovim with ruby lsp
I have tried this with a custom configuration and with the default LazyVim distribution.When I trigger vim.lsp.buf.rename(), for example in LazyVim with <leader>cr I get a error message stating...
View ArticleSelect ruby method definitions in vim
In languages with braces { ... } around a function or method, it is easy to select the inner body definition of a method (see Selecting entire function definition in Vim):You can select the inner body...
View ArticleHow do I setup the ruby SDK in IntelliJ IDEA?
I've been using this guideWhenever I go to import the module I get this screen:I used the following file path, maybe this is whats wrong?/usr/local/Cellar/ruby-build/20160130/share/ruby-build/2.3.0And...
View ArticlePolymorphic Models in Ruby on Rails?
For a project I'm working on, the store has two types of products - a real product and a group of products. For this discussion, let's call them "1 T shirt" and "a box of T shirts". For one t-shirt, I...
View ArticleRegex help, works on rubular not on production? Possible \n issue?
Given this:Come Find me please. This is paragraph one.\n\nThis is paragraph two. Capture everything before me as this is the last sentence.\n\n\n\nFrom: XXX XXX <xxxxx@gmail.com>\nDate: Mon, 17...
View Articleflutter on mac using VScode - instll cocoapods errorr
i have this errors, i tried so hard to fix but not lucky..1- i want to install cocoa-pods for my flutter on mac iPhone project2- but the system tell me must instal ruby , but i faced issues when i...
View ArticleGrover.to_pdf: ReadableStream is not defined
I have a Rails app that is using the Grover Ruby gem, and it converts HTML to images perfectly well, but when I try to convert it to a PDF as shown below, I get an error saying the ReadableStream is...
View ArticleAttempting to link projects to show
I have a list of projects, and I try to make an each do in which each of them should lead to its own project, but instead I get an error 'unexpected keyword_ensure', expecting end-of-input, however, I...
View Articlejekyll 4.0.0 | Error: uninitialized constant TZInfo::Timezone
i want to view website on a live server ..but im not familiar with jekyll yetfirst i tried bundle exec jekyll serve and this is the output in atom terminal: PS...
View ArticleSorting an array of objects in Ruby by object attribute?
I have an array of objects in Ruby on Rails. I want to sort the array by an attribute of the object. Is it possible?
View ArticleSort by date in descending order in Ruby on Rails
I would like to sort my list in a descending order by date which as a "New user list", in the database I have a column which is t.datetime "created_at", null: false This is the time when a new user...
View ArticleSomehow Rails/Ruby removed 'US/Eastern' after upgrade?
When I was using 7.0.8.6 with ruby 3.2.2, the US/Eastern was working fine and now I am getting error when doing:irb(main):001:0>...
View ArticleBUILD FAILED (Ubuntu 20.04 using ruby-build 20210119)
I'm using rbenv and in Ec2 instance I'm trying to install a ruby different version but when I executerbenv install 2.7.2following errors occur.Downloading ruby-2.7.2.tar.bz2...->...
View ArticleHow do I know that a gem is compatible with a version of rails?
I'm just getting started with ruby on rails and as I follow the tutorial, there isn't an explanation of how certain gems were gathered and placed in the Gemfile. I've just been copying and pasting them...
View ArticleRuby Net::HTTP not sending TCP Keep-Alive packets, resulting in...
I'm interacting with an API that accepts POST requests over HTTPS and responds with XML. The data take a long time for the remote server to generate, which means that my local client waits for several...
View ArticleHow to render HTML with Haml::Engine from Haml 6.3?
This code worked for Haml 5:require 'haml/engine'engine = Haml::Engine.new('= bar')engine.render(Object.new, { bar: 'hello, world!' })It doesn't work with Haml...
View ArticleHow do I access class variable?
class TestController < ApplicationController def test @goodbay = TestClass.varible endendclass TestClass @@varible = "var"endand i get error undefined method 'varible' for TestClass:Class on the...
View ArticleIs it possible to solve this vagrant ruby gems error?
When i try to start up a vragant environment (VirtualBox) i get the following error:$ vagrantC:/Program Files/Vagrant/embedded/mingw64/lib/ruby/3.3.0/win32/registry.rb:656:in `encode': incomplete...
View ArticleIssue with Ruby in CI/CD environment on Linux: /usr/bin/env: 'ruby.exe': No...
I am facing an issue when running my tests and lint checks on GitHub Actions. The error that appears is:/usr/bin/env: 'ruby.exe': No such file or directory.I am developing on Windows, but the CI/CD...
View Article