Category "ruby"

Rails - a way to check the last line while using smarter_csv gem

I am using smarter_csv gem to parse a large CSV file on Heroku. SmarterCSV.process(file_name, { chunk_size: 10, headers_in_file: false, user_provided_headers: u

Error: Could not find sqlite3-1.4.0 in any of the sources

I'm currently trying to get a run.rb file going, but I keep getting errors with sqlite3. When I type bundle install, I get this success message: Fetching gem m

Gem to local libray in Rails

My boss asked me to write a gem to wrap an API (canvas) consumer for our app, I did it and it works, but in the last minute he asked me not to use the gem appro

Login with devise-jwt authentication?

I cannot figure out how to send a post request to login on devise with devise-jwt I use devise as web authentication, but want to add an endpoint for api authen

Decode base45 string

We are trying to implement the verification of the new EU corona virus test/vaccination certificates, but can't get the base45 decoding working. Specification i

macOS Mojave 'ruby/config.h' file not found

When I try to build vim(8.1.0509) with ruby support(--enable-rubyinterp) on macOS Mojave(10.14.1) I get error: In file included from /System/Library/Frameworks/

How to pre-fill arguments to a function in Ruby?

Let's say I have a function foo: def foo(A, B, C) A + B + C end And I call it like this, with only the last parameter changing: foo("foo", "bar", "123") foo("

Retrieve the balance for a Stripe Connect connected account?

How can the balance on a connected account be retreieved? (e.g. a connected account is like the 'host' in the Airbnb example). I checked the balances docs, and

Can we actually do rspec testing on ruby if my methods don't have parameters?

I have a method but doesn't have a parameter, for example def goodbye puts "" puts "Thank you, #{name} for using our service." puts "Good luck with

byebug isn't displaying the output as I type

I've experienced an odd interface glitch. [44, 53] in /document.rb 44: code 45: code 46: 47: def code 48: byebug => 49:

Installing cocoapods on Mac with M1 chip issues

I've been trying to install cocoapods and I managed to do that but now I'm getting this issue.I've gone through home-brew to install the latest version of ruby

Asdf wont switch local version based on tool-versions or using the local command

I downloaded asdf the other day and am trying to use it with a ruby on rails project I downloaded from Github. When I run asdf install, I get this response: fir

Twilio with Capybara Getting "stack level too deep (SystemStackError)" error

I am getting stack level too deep (SystemStackError) error when trying to make Read: List messages matching filter criteria API call for Twilio in Selenium/Cucu

VSCode - Rubocop - Settings.json - End of file expected

I am using VisualStudioCode with Ruby and Rubocop. After installation of Rubocop i found out i must change some of the settings in settings.json for Rubocop. Ho

Fail to compile webpack when I run ruby server

I have try to run my ruby server and I got this error : [Webpacker] Compiling... [Webpacker] Compilation failed: /var/lib/gems/2.7.0/gems/webpacker-5.2.1/lib/we

what is the functionality of "&: " operator in ruby? [duplicate]

Possible Duplicate:What does map(&:name) mean in Ruby? I came across a code snippet which had the following a.each_slice(2).map(

Dynamic constant assignment

class MyClass def mymethod MYCONSTANT = "blah" end end gives me the error: SyntaxError: dynamic constant assignment error Why is this considered

Find records with missing associated records in Rails

I have a legacy database where I have two models as: class Purchase belongs_to :product end class Product has_many :purchases end Now over time some of

How to handle memoization with nil values with Sorbet?

I have this method: def current_organization return @current_organization if defined?(@current_organization) subdomain = request.subdomain.to_s r

Amazon SP-API String to sign is returning different signed strings

This is interesting. For some reason my request to the Amazon SP-API is perfect EXCEPT for this last bit. @string_to_sign= "AWS4-HMAC-SHA256\n" + "20220512