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

How do I use Rspec shared_examples across different files?

I want to reuse this shared_examples block across different spec files. I want to extract it into a separate file, and pass in the object so it's not always user. Both things I tried failed, is it...

View Article


How can I specify decimal schema formats in RSpec/RSwag when decimal...

So my :decimal formatted DB field is being returned as a string, and making my tests fail.I have a request spec, using RSwag, that I'm trying to get to pass with a format check, yet it's telling me the...

View Article


how to change subject for shoulda matchers

I'm having trouble with the following attributes within my class. I have a date attribute with presence true that is enforced at database level too:validates :date, presence: trueIn addition to that, I...

View Article

Drop index concurrently when testing Rails migration in Rspec

I'm writing an Rspec test to test a new migration with Rails ActiveRecord for a postgres database. The migration file adds an index concurrently, and so my migration...

View Article

can't find gem cocoapods (>= 0.a) with executable pod (react-native pod install)

I just start a react-native project. However, this question had me for a day.I tried all possible way to solve it. For example,sudo gem uninstall cocoapodsrvm uninstallbrew install cocoapodsHowever,...

View Article


QR Codes not displaying in emails, Rails

I'm dealing with a legacy Rails website. I am trying to put QR codes in an email (which otherwise works normally on the website), uses QRCode.js.<% @tires.each do |tire| %><h3>TIRE <%=...

View Article

Error with ruby version on termux when I try to install metasploit

I was installing metasploit with termux and it said:termux output~ $ ls <br>metasploit-framework storage wiki-termux<br>~ $ cd metasploit-framework<br>~/metasploit-framework $ ruby...

View Article

What is the difference between Raising Exceptions vs Throwing Exceptions in...

Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue.Why do we have two?When should you use one and not the other?

View Article


Not able to load the assets from the vendor folder in rails

I'm a newbie to ruby on rails and trying to build the Instagram-clone and I'm following a youtube tutorial. Click here for the tutorialI used a third party template and loaded the bootstrap.min.scc...

View Article


How to run a cron script with gitlab-rails

I have gitlab-rails withGitLab 15.0.4Rails version 6.1.4.7Ruby version ruby 2.7.5I want to run a gitlab-rails script from Cron. The gitlab-rails runner seems to be broken as it doesn't recognize the...

View Article

OTel-ruby-sdk 'Custom-Sampler isn’t being applied

I'm currently in the process of setting up the Otel SDK for our Ruby application. As part of this instrumentation, I've decided to use a custom sampler called TraceIdRatioBasedSampler. However, I'm...

View Article

how can I change the default syntax coloring in ruby 3.0's IRB

I'm very happy to be using the most recent ruby 3.0; as well as having access to the updated command-line interpreter which does syntax highlighting and coloring.However, the colors are a bit hard to...

View Article

Iterating over a Nested array in ruby

test_scores = [ [97, 76, 79, 93], [79, 84, 76, 79], [88, 67, 64, 76], [94, 55, 67, 81]]puts test_scores.any? do |scores| scores.all? { |score| score > 80 }endWhen I run the above code on Replit...

View Article


mac os ruby installation fails on -> make -j 8

I have tried rbenv, rvm, asdf but they all fail at -> make -j 8.Apple M114.3 (Sonoma)asdf install ruby latest ruby-build: using openssl@3 from homebrew==> Downloading ruby-3.3.0.tar.gz...->...

View Article

Rails Overriding Gem Controllers

I am working with a gem in my Rails app that has a controller located in <gem_root>/app/controllers/<gem_name>/things_controller.rb. I need to override (more specifically, extend) one of...

View Article


Image may be NSFW.
Clik here to view.

fastlane finished with errors "Shell error" [!] Exit status of command...

Hi i am using fastlane for update localization string files in the project, It was working perfectly on M1 but when I change to M1 Pro, fastelane giving this error.[✔] 🚀[19:07:30]: fastlane detected a...

View Article

CocoaPods folder does not exist / permissions error

I'm new to CocoaPods, I tried running 'pod install' on my Mac to install my pod, but I'm getting a permissions error with the folder /Users/username/Library/Caches/CocoaPods. That folder doesn't even...

View Article


is there a way to write this clean?

So i have a flag to disable and enable a feature. and will based on the variable it has to toggle the flagsflag_a, flag_b, are my two feature flags and the variable input string can be none,...

View Article

Having default Rails generators call a custom generator

To be clear, here's NOT what I'm trying to:Have my custom generator call a default Rails generatorReplace a default Rails generator with my ownWhat I want to do is have my generator be invoked...

View Article

Image not displaying in Wicked PDF generated PDF in Rails

I'm facing an issue where the image border is being displayed in the PDF generated by Wicked PDF in my Rails application,but the actual image content is not showing up. I've confirmed that the images...

View Article
Browsing all 4627 articles
Browse latest View live


Latest Images

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