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

Capistrano fail to deploy rails app due to incompatibility with OpenSSL 3.0

I have a rails application with Rails 7 and Ruby 3 support, which is working well in my development machine with Ubuntu 22.04, ruby 3.0.2p107 and Rails 7.0.2.3.Now I'm trying to set up Capistrano...

View Article


Rails Alpha2 country to Real country name

I am using country gem https://github.com/hexorx/countries and trying to get the the country name from alpha2 country names. but it comes as [object object]. here is my code. render :json =>...

View Article


Possible to use a "database first" approach in ruby on rails?

Would it be possible to create a db schema in a GUI mysql administator and then create (or update) a model based on this schema?

View Article

How to get path from URL when filename contains question mark

I have a url like this:url = www.example.com/resources/am_i_a_file?.pdfwhere the filename contains a question mark (I know....)When I try the following:uri = URI::parse(url)path_raw = uri.pathI get:...

View Article

Can't understand "unless" keyword in Ruby

I'm not a native English speaker. I know it sounds stupid nonetheless. I write in Python & C. But I can't quite understand how unless works.Is it healthy to think of it from a logical standpoint?...

View Article


Image may be NSFW.
Clik here to view.

How to make a manual job always exit with success on GitLab CI?

On my Gitlab CI I run the gem https://rubygems.org/gems/brakeman as a manual stage. When it finds any warning or error, on Gitlab CI in the end, after it's gone through all the code, it exits with...

View Article

ENOENT Error when trying to create Excel file in Ruby

EDIT 2: I've managed to resolve the directory issue and it creates the CSV file without issue, however when I try to export the file as a XLSX file using the save_to_xlsx method, the program still...

View Article

How to get the path of a file without normalisation in ruby?

My current directory path is /a/b/c/When I dofname = File.path("../test.rb")::File.absolute_path(fname) output is: /a/b/test.rb What I am expecting is the output something like this: /a/b/c/../test.rb...

View Article


Why is it best to store a telephone number as a string vs. integer?

As the question states, why is it considered best practice to store telephone numbers as strings rather than integers in the telephone_number column?Not sure I understand the rationale for this. Please...

View Article


Include Fulfilled Orders In ShopifyAPI::Order.All

As a part of my shopify application I would like to keep a local export of every single one of my orders. I have a ruby script that achieves most of what I need here, but it only fetches unfulfilled...

View Article

Ruby Serialising and deserialising json

I have this two function to serialise and deserialise game state. I got it working okay. But It feels very cluttered and messy. Is there a better approach of doing this?There is two different class...

View Article

ruby selenium click on button with class name

I'm using ruby and selenium to test a web page, with the two buttons below<div class="AVdis"><span class="gwt-InlineHTML"/><a class="AVcur" name="attendEdit"; font-size:...

View Article

Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set, see:...

I keep getting this error every time I open my terminal:Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set, see:https://github.com/wayneeseguin/rvm/issues/3212This started happening...

View Article


How to filter app bundle ids from list of string in ruby

I have a list of strings that are either urls, domains, and app bundle IDs I want a ruby code or either regular expression that can filter out app bundle IDs from the list of strings. Here is an...

View Article

How to find current stack size in bytes in Ruby

In Ruby, it appears you can set the size of the stack with the RUBY_THREAD_VM_STACK_SIZE environment variable.Is there a way to programmatically determine the current size of the stack? This would be a...

View Article


running a ruby script in notepad++

I've pasted the following code in notepad:puts ("enter a number")x = gets.to_iputs ("enter a second number")y = gets.to_iresult = x + yputs resultI've also created the following batch file:@echo...

View Article

active storage url giving 404

I am currently using Active Storage to upload images. However, when I attempt to display the image on the Active Admin index, I receive a "No webpage was found for the web address page not found" error...

View Article


Get ordered list of middleware in a generic rack application?

The functionality I am looking for is similar to the rake middleware command in Rails, except for a generic rack application.

View Article

Ruby with Rails app with Shopify keep deploying fine but on any controller...

I've made few updates to a Shopify app running on Ruby/Rails, updates were simply new release updated made and logic + code adjusted. Everything works when it comes to deployment of the app with new...

View Article

Trouble with zxing Gem in Ruby 3.2.1 on Rails 7.1.1: Uninitialized Extensions

I'm currently developing a Rails 7.1.1 application using Ruby 3.2.1, and I've encountered an issue when trying to use the zxing gem for barcode reading functionalities. Despite following the...

View Article
Browsing all 4642 articles
Browse latest View live


Latest Images