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

How can I overcome Nokogiri dependency when dockerizing Ruby on Rails APi

I've been working on dockerizing a simple Ruby on Rails API with a SQL database, and I've been encountering the following error:ERROR: It looks like you're trying to use Nokogiri as a precompiled...

View Article


How to ignore a folder in Zeitwerk for Rails 6?

Simple question, but somehow the answer escapes me.In moving to Rails 6 with Zeitwerk, I get:Please, check the "Autoloading and Reloading Constants" guide for solutions. (called from <top...

View Article


Convert array-of-hashes to a hash-of-hashes, indexed by an attribute of the...

I've got an array of hashes representing objects as a response to an API call. I need to pull data from some of the hashes, and one particular key serves as an id for the hash object. I would like to...

View Article

Reserved key when using I18n-tasks add-missing

I'm developing a ruby on rails app.I've been using the i18n-tasks gem from the start.My "i18n-tasks add-missing" command has never caused any problems, I haven't used it for 2-3 weeks, when I use it,...

View Article

How do you get DateTime.parse to return a time in your time zone?

I need this require 'date' DateTime.parse "Mon, Dec 27 6:30pm"to return a DateTime for 6:30pm in the EDT timezone, but it returns one in UTC. How can I get a EST DateTime or convert the UTC one into an...

View Article


Could not find gem 'mysql2 (= 0.5.3)' in locally installed gems

I'm trying to create a my project last, run commandrails serverThe source contains the following gems matching 'mysql2':mysql2-0.5.6Run bundle install to install missing gems.I am Try run bundle...

View Article

ArgumentError: Unknown field error Ruby JSON.parse(json_string, object_class:...

My Ruby class Routeguide::Rectangle object looks like this, (Pay attention on lo & hi variables, those are objects of class Routeguide::Point)<Routeguide::Rectangle: lo: <Routeguide::Point:...

View Article

Installing rbtrace 0.4.14 with native extensions Gem::Ext::BuildError: ERROR:...

This happened to me several times while trying to install Discourse:Cannot install rbtrace with native extensions.Gem::Ext::BuildError: ERROR: Failed to build gem native extension.*** extconf.rb failed...

View Article


Ruby on Rails Active Storage (bug?)

I've encountered something really strange, like I see I may be the first one tackling with this. To the basis - I've got a table with all employees, each employee has an NFC id card as id column, their...

View Article


Update just one gem with bundler

I use bundler to manage dependencies in my rails app, and I have a gem hosted in a git repository included as followed:gem 'gem-name', :git => 'path/to/my/gem.git'To update this gem, I execute...

View Article

How to fetch Auth0 user information with code got from Login API?

I am using Ruby on rails for developing my web application and using gem auth0, and I am integrating Auth0 with Onelogin and using custom sign in form. When I tries to sign in with Onelogin I am being...

View Article

Heroku Platform API - Domain Create Error

I'm trying to create custom domains in Heroku through a controller action in my rails app. For now I just have a method in a controller to create the domains. I've been messing around with it for a few...

View Article

dragonruby Dir class not supported?

I'm attempting to iterate through files in a sequence to create a small animation using DragonRuby, but I'm encountering an error when attempting to use the Dir class, which is commonly used in Ruby....

View Article


What is the effect of hash and eq implementation in Ruby

class A def hash 12 end def ==(other) true endendx = {}a = A.newb = A.newx[a] = "Hello"x[b] = "World"puts xThis is printing:{#<A:0x000055d1f3985c68>=>"Hello",...

View Article

Nginx error: client intended to send too large body

Periodically I get an error:This site can't be reached.The webpage at https://example.com/document might be temporarily down or it my have moved permanently to are new web address.My site is stored on...

View Article


how to find the time taken for each testcase in Rspec

I am using Rspec in my project where I would like to print the time taken by each testcase, Is there any way Rspec is providing any prebuilt function? I can take the starting time of the testcase by...

View Article

Difference between background jobs, rake tasks and cronjobs in Ruby on Rails?

I have just started exploring rake tasks and cronjobs in rails. I was confused about the comparison among them and what to you in which situation. As far as I know background job is something that is...

View Article


Ruby: Can I write multi-line string with no concatenation?

Is there a way to make this look a little better?conn.exec 'select attr1, attr2, attr3, attr4, attr5, attr6, attr7 '+'from table1, table2, table3, etc, etc, etc, etc, etc, '+'where etc etc etc etc etc...

View Article

httparty: how to log request?

How do I log requests being sent with with httparty?HTTParty.post( @application_url, :headers => {"Accept" => "application/json","Content-Type" => "application/json; charset=utf-8" }, :body...

View Article

Rubocop Lint/UselessAssignment offense not detected

With Ruby3.3.0 (rbenv global) and rubocop 1.60.2, I noticed that sometime 'useless assignements' are not detected. Below is an example where offense is detected for foo, but not for bar.#!/usr/bin/env...

View Article
Browsing all 4612 articles
Browse latest View live


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