Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Browsing all 4616 articles
Browse latest View live
↧

How to search in rails 7 with ransack when action text rich text using in the...

Could somebody help me to figure out why it is not working?So what is the story: there is a rails 7 (7.1.3) blog app with a ransack version 4.1.1In the search form, I need to search text by the post...

View Article


How can I get a page count of the full URL in the Ruby GA4 client?

I have been trying to query GA4 for page counts using the code below which I got from this article and linked git. I can get results using the dimension "pagePath" but this only gives me the URL before...

View Article


Spotify URL / Link to artist blocked in Airtable

I'm working on a ruby script taking my followed artists on Spotify, and sending them to Airtable so that I can quickly build my own "Spotify Interface" and do some things like sort by "genres" or add...

View Article

The Ruby Fiddle Module has a bunch of constants to represent C data types (eg...

The Ruby doc for Fiddle only has Fiddle::TYPE_VOIDP for representing C pointer data types, but nothing for char* or int* or unsigned int*. How do you represent these data types in Fiddle?

View Article

Find last created_at record

How can I find the last record by their created_at field? Record.order("created_at").lastor Record.where(:created_at).lastor Neither and there is a better way?

View Article


Ruby OOP: What causes NameError in Game Object?

I am learning OOP with Ruby. I have 2 classes - Game & Player.Player and Computer are to be created for Tick-Tack-Toe game. My idea is to use Player class to create a player and a computer for the...

View Article

How to configure GRPC client retry for Ruby via Service Config

so i have been stuck on how configuring GRPC client retry on Ruby. The code to reproduce is taken from https://github.com/grpc/grpc/tree/master/examples/ruby/errors_and_cancellationThe pb files can be...

View Article

How do I figure out which gem(s) caused a particular gem to be bundled?

Is there a simple (Bundle?) command to determine which gem(s) caused a particular gem to be bundled and added to my Gemfile.lock?There are one or two similar questions but they only seem to address the...

View Article


Image may be NSFW.
Clik here to view.

GitHub Actions CI - Gem/Rails Engine - Ruby v3.3.1/Bundler errors

I'm writing a Ruby gem / Rails engine, blacklight_allmaps, and using GitHub Actions for CI. Yesterday, my test builds for Ruby v3.2 passed fine, but my Ruby v3.3 tests began to fail with an odd...

View Article


ruby 3.1: Using &method(:name) to simplify code fails inexplicably

ruby 3.1.2kubuntu 22.04The method to extract the base domain name (excluding sub-domain) from a URI:def host_name(a) URI(a).host.sub(/\Awww\./, '')endUse:uri_array = ['https://www.example.org',...

View Article

Per-user or per-project gem cache path

Trying to pack my Ruby app, I get a lot of errors like this:Bundler::PermissionError There was an error while trying to writeto `/opt/ruby/lib/ruby/gems/3.3.0/cache/nio4r-2.7.1.gem`. It islikely that...

View Article

How to assigne value to RbConfig::CONFIG?

I am trying to build ruby gem. I need to change values set in rbconfig.rb in my gem file extconf.rb.I do not want change rbconfig.rbas example new values defined in extconf.rb should look...

View Article

How does gem decide, which arch-specific gem to install?

For example; if I want to install any architecture-dependent gem, like nokogiri (xml library for ruby), but for any architecture-dependent gem, the case is the same.I use an x86 distribution, but on an...

View Article


How do I get Linux system information in Ruby?

How do I get the software/hardware information of a linux system (this has to work for Fedora, Ubuntu etc) in Ruby?

View Article

Have the Ruby logger create log files only if log messages exists

I want Ruby to log into a file, but only if there are acutally log messages. I don't want to get empty log files without any messages.I used the answer at Can I disable the log header for ruby logger?...

View Article


How to add an item to a form? [closed]

I'm new to Ruby on Rails. I need to add an item to a form without entering any information. The information will be taken from the seeds.rb file. Is there any way that can happen? I'm aware of the...

View Article

`bin/rails server` opening a text file instead of running a local server

Starting a rails tutorial: https://guides.rubyonrails.org/getting_started.html.Followed every step but when I get to running the command bin/rails server the text file below opens instead of running a...

View Article


Ruby: How can I read a regex from a file, then parse strings using that regex?

This is one of the most difficult things to search for because when you search how to parse a regex you get how to parse with a regex. I want to read a regex from a file, put it in an object somehow,...

View Article

rbenv: can't install ruby 2.1.0 after upgrading to MacOS Sonoma 14 from Big Sur

I have a legacy application that uses ruby 2.1.0 and$ rbenv install 2.1.0worked fine in BigSur.However after updating to MacOS 14.4.1 Sonoma from Big Sur 11 I can't get it to work.I've replaced the old...

View Article

installing shopify-cli on Windows

I tried installing the Shopify app CLI through the command:gem install shopify-cliOutput:ERROR: Error installing shopify-cli:"theme-check-language-server.bat" from theme-check conflicts with...

View Article
Browsing all 4616 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>