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

Friendly Byte Formatting in Rails

I need to format an integer representation of bytes into something friendly, and I'm hoping that there's a utility function in Ruby or in Rails that will do that formatting for me (to perpetuate my...

View Article


bundle install fails with SSL certificate verification error

When I run bundle install for my Rails 3 project on Centos 5.5 it fails with an error:Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate...

View Article


Access with personal account to multi-tenant application AAD

I have multi-tenant application and I would like all users of all types could access my application. I have read that AAD API version 2.0 have possibility to access all types of account, i.e. work,...

View Article

S3 creates signed URLs for items that do not exist

S3 presigned URLs are being created for items that do not exist. Is this normal behavior? I would rather know if the item is not going to exist when creating the link, than send users to an error page....

View Article

Why including Rescuable module doesn't work?

class MyKlass include ActiveSupport::Rescuable rescue_from Exception do return "rescued" end #other stuffendMyKlass is pure ruby object, but defined inside Rails application.If I try to invoke MyKlass...

View Article


Spree Deface select 3rd element

I have a ul with with li elements having exactly the same class - let's call it abc class. I was wondering how can I select the third element. I was able to select the first one by using :first but...

View Article

How to load an SQLite Binary data dump into an in-memory read-only database...

I have an SQLite binary dump of around 10mb. The dumped database contains some catalogue data, which I need to be able to read from really fast from a Ruby application (sub-millisecond). Therefore I...

View Article

New to Ruby - how do I shuffle a string?

Want to shuffle a string.This is my code:what is wrong about it?Thanks.>> def string_shuffle(s)>> s.split('').shuffle(s.length()).join>> return s>> end

View Article


Refactoring Pokemon type weekness

I made pokemon weekness finder by ruby. It takes a lot of words.Could you suggest bit nice and sophisticated to write this code?The menu is as follows.puts "Which type of Pokemon do you want to know...

View Article


FreeBSD 14.0, Ruby on Rails deployment issues (gem sqlite3 not installing)

I'm trying to deploy rails in FreeBSD 14.0 and when I try to deploy a new project, using rails new truck command I'm receiving the following error:package configuration for...

View Article

install ruby with asdf hangs forever

I am using asdf-ruby to install ruby 3, using chef execute.execute 'install_ruby_with_asdf' do command "#{asdf} install ruby #{ruby_version}" action :run user user environment({ 'HOME' => deploy_dir...

View Article

What is the meaning of "h" in ""?

When I generate a default scaffold, the display tags on show.html.erb have<%=h @broker.name %>I know the difference between <% and <%=. What's the "h" do?

View Article

Required ruby-3.2.2 is not installed. To install do: 'rvm install "ruby-3.2.2"'

I have installed ruby 3.2.2 via rbenv and set both the local and global to this version.On running command ruby -v it is showing 3.2.2 but when I cd into the new rails app it is showing this:Required...

View Article


Ruby: Listen on TCPsocket for individual bytes (no CR/LF) and write to file

I'd like to write a server that listens on a given TCP port, captures incoming data and processes it one byte at a time (the amount of data coming in is minimal - a few kilobytes per hour)For...

View Article

Regular expression to select symbol with only digits in word

Can't create a regular expression that would select the "X" symbol that is between digits and a word does not contain other letters or "X" is on the first or last place of a word....

View Article


Regular expression to capture the first 4 Numbers from a string [duplicate]

Was playing around with regex to learn it better and wondering if we can write regex to match something like the following use case belowExample String: 1_234_3456_345Expected result: I want to match...

View Article

Image may be NSFW.
Clik here to view.

Could not spawn process for application redmine-5.1 in any of the sources...

I upgraded debian 9 to debian 12, updated all packages. I need to update redmine 3.4.6 to redmine 5.1. I did everything according to the instructions, but when I open the ip address/redmine link, I get...

View Article


Selenium::WebDriver::Error::WebDriverError: no sessionId in returned payload...

Upgraded ruby from 2.5.3 to 3.1.2 and associated gems. Cucumber tests were running fine against v 2.5.3 on chrome but now getting the below error and stack trace. Also attached my gemfile.lockSELENIUM...

View Article

I am facing issue of incoming screen in ios,when i call from aghora that time...

i am facing issue of ios incoming screen when i call receive from another user i see only cut button in imcoming screen not see the accept button i have use flutter_incoming_callkit.And this...

View Article

How to check if a Rails model is defined? [duplicate]

I'm using a Ruby on Rails 5.2.8 and Ruby 2.7.8 version and I have found a bug in code. The code should check at runtime if a model is defined. At first I tried to use the defined? method, but because...

View Article
Browsing all 4604 articles
Browse latest View live


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