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

can't modify frozen Module (FrozenError)

locally the app seems to be working fine, I can start the server and the app loads correctly, however, when I deploy to a remote environment I get 500 error, then looking at the logs I see this error...

View Article


rails 6 has_one relation error "can't write unknown attribute `#{name}`"

I' am using rails 6.1 and I trying to define a has_one relation, this is my current model definitions:class Session < ApplicationRecord self.implicit_order_column = 'created_at' belongs_to...

View Article


Macbook M2Pro - Error running '__rvm_make -j12'

Error running '__rvm_make -j12',please read /Users/scari/.rvm/log/1706650388_ruby-2.7.3/make.logThere has been an error while running make. Halting the installation.When trying to install ruby-2.7.3 on...

View Article

Accumulator pattern for ruby_block or other non-template resource

I want to create a chef accumulator custom resource that accumulates data from multiple instances, and then uses a ruby_block resource to modify an existing file.All the examples of accumulators that I...

View Article

SOAP call to WCF Web Service from Ruby on Rails App

I need to call an old 3rd-party WCF web service (which I have no control over) from my Ruby on Rails app. My biggest problem is that the request content-type has to be application/soap+msbin1 (aka...

View Article


Parse HTML using ruby core libraries? (ie, no gems required)

Some friends and I have been working on a set of scripts that make it easier to do work on the machines at uni. One of these tools currently uses Nokogiri, but in order for these tools to run on all...

View Article

Ruby replace string with captured regex pattern

I am having trouble translating this into Ruby.Here is a piece of JavaScript that does exactly what I want to do:function get_code(str){ return str.replace(/^(Z_.*):...

View Article

Rails API with frontend - routing email links to backend or frontend application

I have a Rails API backend and a ReactJS frontend. My backend sends custom emails that often have confirmation-like links (like email confirmation)Should the confirmation links point to my backend...

View Article


Rails not able to find partial

I have a folder structure likeproject/app/views/api/users/_user.json.jbuilderThe error isSearched in: * "/Users/name/Desktop/etc/etc/project/app/views"ActionView::MissingTemplate - Missing partial...

View Article


issue with yahoofinance ruby api return value

I know joining arrays and strings but this issue is very specific to anapi I am working on :All I want is all hq.close value in an array. EG:[ {'GOOG' => [744.75,751.48,744.56,744.09,757.84]},...

View Article

How to downgrade or install an older version of Cocoapods

How can I downgrade Cocoapods to an older version, or how can I install an older version of Cocoapods?

View Article

Trying to deploy ruby on rails on render web service giving issue:...

I am using rails 6.1.4 with ruby 3.0.2. i have an app that i m trying to deploy on render.com and i have tried both the options (manual deploy and blueprint). i am still getting the following issue:*...

View Article

Jekyll kramdown math render settings

I recently updated to Jekyll 4.0.1 I have made plugin which detects and render latex expressions to html using katex. But now Jekyll's kramdown renders latex expressions differently. In old jekyll...

View Article


How to display numeric value 0.0 as 0.00 as the query result

The value saved in the database is 0.0 as numeric data type.How to display the numeric value 0.0 as 0.00 as the query result?

View Article

Rails 7 new app with --css bootstrap - turbo buttons won't work

When creating new app Rails 7 with rails new myapp --css bootstrap my turbo button won't work:= button_to "Sign out", edit_post_path, method: :delete, form: { data: { turbo_confirm: "Are you sure?" } }...

View Article


doubts regarding "||=" OR EQUALS operator in ruby [duplicate]

I have some doubts regarding OR EQUALS (||=) operator in ruby. How does ruby interpreter implement it? Here is a sample of code:class C def arr @num ||= [] endendWhen we use OR EQUALS operator in this...

View Article

What exactly does it stand for `ClassName.(params: params)` in Rails?

I've seen this syntax:ClassName.(params: params) but I don't get what exactly it does under the hood. Is it an alternative to .call or .new?

View Article


How to use $in with Mongoid?

How I setup my data in an rspeclet(:first_origin) { create(:origin, owner: "123@tenant") }let(:second_origin) { create(:origin, owner: "123@tenant") }create_list(:ticket, 10, origin:...

View Article

Best way to add comments in erb

How do we add comments in erb files, if we do not want them to be generated into the html content?

View Article

Does Ruby uniq preserve ordering?

The documentation doesn't say anything about that (http://www.ruby-doc.org/core-2.2.0/Array.html#method-i-uniq). Also, is it using a naive O(n^2) search or something else like a hashmap ? In the latter...

View Article
Browsing all 4666 articles
Browse latest View live


Latest Images

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