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

Why does GitHub API rate limit decrease from 5000 to >30 after initial request?

I have a list of GH users that I am searching by email address. However, the api rate limit becomes really stingy after the initial request.client = Octokit::Client.new(:access_token =>...

View Article


Zlib gunzip only returning partial file

I have a 27MB .gz file (127MB unzipped). Using ruby's Zlib to ungzip the file returns correctly formatted data, but the file is truncated to a fraction of the expected size (1290 rows of data out of...

View Article


RubyMine says ruby not installed, but is

When I open up a Rails project in RubyMine, I get the error message, "Required ruby-3.3.0 is not installed." However, I enter the command ruby --version and the terminal outputs ruby 3.3.0. What's wrong?

View Article

What's the Problem with ruby, jekyll, and rack/handler

I'am forked github project sujaykundo777 and wishing to customizing my blogfor that, I downloaded Ruby to make blog with 127.0.0.1but It's too many error to making blogTo resolve the error, I deleted...

View Article

Rails enum symbol vs string [closed]

I have just started working on a new rails project, and I have noticed that the previous developer has used strings instead of symbols as keys for the enum. The example is as follows: enum event_type:...

View Article


Can the rack-proxy be used to redirect some http requests to a SOCKS5 proxy?

Can the rack-proxy be used to redirect some http requests to a SOCKS5 proxy ?

View Article

ActiveAdmin in rails engine give me that error : uninitialized constant...

I installed activeadmin in a rails engine that I mounted in my main application. When I try to access the home page I get the following error: uninitialized constant BackOffice::AdminThe code in...

View Article

PUPPET ERROR expected chomping or indentation indicators

2024-02-06T12:50:38.562+01:00 ERROR [qtp488725606-52] [puppetserver] Puppet Server Error: Could not load external node results for "mynode": (): expected chomping or indentation indicators, but found...

View Article


Change the context/binding inside a block in ruby

I have a DSL in Ruby that works like so:desc 'list all todos'command :list do |c| c.desc 'show todos in long form' c.switch :l c.action do |global,option,args| # some code that's not relevant to this...

View Article


How to implement a field in the Rails Admin that displays a dropdown list...

I'm trying to implement the following logic for the :value field:if :key == "test", then a drop-down list with two options ['option1', 'option2] is displayedin any other case, a normal line field is...

View Article

Why is GitHub Actions unable to find rubocop and httparty gems?

I'm trying to develop a Ruby script that does some API calls using a couple of Classes that use the httparty gem in another rb file in a separate directory like this:./script.rb./lib./lib/calls.rbThe...

View Article

A ruby script to run tail on a log file?

I want to write a ruby script that read from a config file that will have filenames, and then when I run the script it will take the tail of each file and output the console.What's the best way to go...

View Article

How to achieve this? Arduino + webserver 2024 [closed]

For the more advanced people,I want to start a small project with my arduino. The idea is to have this communication flow:arduino <-> wireless board like esp32 or nano iot <-> Wi-Fi...

View Article


Why is Jekyll not working at all with Ruby 3.1?

I executed using Ruby 3.1:gem install jekyllThen I executed:jekyll -vAnd I got this error:`require': cannot load such file -- sass-embedded (LoadError)I tried to update ruby 3.1.2 to...

View Article

How to group by count in array without using loop

arr = [1,2,1,3,5,2,4]How can I count the array by group value with sorting? I need the following output:x[1] = 2 x[2] = 2 x[3] = 1 x[4] = 1 x[5] = 1

View Article


Better alternative to try method

I would like a clean piece of code and I think this feels clunky.Is there a better way to do this?User.try(:profile).try(:settings).try(:card).try(:options)If I eliminate the try methods, I get a nil...

View Article

Rails: Enums with hashes not returning hash key:value

I am building a Ruby on Rails Application where I have model attributes that are static like Gender and Status. I have decided to define them as enums in the models. I am using the ruby-enum gem to...

View Article


How do I extend my ruby class with a c extension?

If I have Foo::Bar written in Ruby, and I want to add a method to Bar as a C extension. Right now when I create Foo::Bar in C like this:static VALUE Foo;static VALUE Bar;static VALUE print_string(VALUE...

View Article

Ruby/PgSQL error on Rails start : cannot load such file -- pg_ext (LoadError)

I'm new to Ruby (coming from a Java background) and was given access to a RoR project from a Git repository. I was able to get Ruby built with rbenv and Postgres installed via homebrew, installed the...

View Article

Possible to use Action Cable in Rails 6 on Sprockets?. I am stuck here

I realize this is a bit of a non-specific question, but I'm not exactly sure where my issue lies, so bear with me please.I am attempting to setup Action Cable in Rails 6.1.4.1 on Sprockets (no...

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>