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

What's the best way to model recurring events in a calendar application?...

I'm building a group calendar application that needs to support recurring events, but all the solutions I've come up with to handle these events seem like a hack. I can limit how far ahead one can...

View Article


Bootstrap Carousel (5.3) not working on Rails 7

I can't find the issue and I've tried a million times. Why isn't this code working? It's the same as in the Bootstrap website minimally modified.It just shows one picture, but the buttons are not...

View Article


Break out a loop from within a (yielded) block inside the loop

jobs.each do |job| msg job.name do break if stop_all_jobs? job.run! endend def msg(msg, &block) puts 'START '+ msg yield puts 'END '+ msgendIn the above example break does not break out of the loop...

View Article

RVM Ruby 3.1.4 fails to install on macOS Sonoma due to perl5.18

I'm trying to install Ruby 3.1.4 version on Sonoma 14.4 with rvm and got this error:Error running '/Users/username/.rvm/src/ruby-3.1.4/autogen.sh', please read...

View Article

Ruby Case statements and pinning, does not work with attr_reader

This code works:class Hello def initialize @name = "Paul" end def say_name(maybe_name) name = self.name case maybe_name in ^name puts "Hello, Paul!" else puts "No match" end end private attr_reader...

View Article


Mongoid polymorphic associations with embeds

I'm confused on how to make polymorphism work with embeds and mongoid 8.x.class Entity include Mongoid::Document embeds_many :custom_fields, as: :itemendclass EmailField include Mongoid::Document field...

View Article

Multiple Blogs In Single Jekyll Website

Is there a way I can have a single Jekyll website have more than one blog? I currently want to have two blogs in one site.

View Article

Ruby issues on Mac M1

I'm having trouble installing Ruby and using homebrew on my M1 Mac.I'm trying to install Ruby so that I can launch a website through Jekyll. I'm following the installation guide on the Jekyll website...

View Article


How do you run a single test/spec file in RSpec?

I want to be able to run a single spec file's tests — for the one file I'm editing, for example. rake spec executes all the specs. My project is not a Rails project, so rake spec:doc doesn't work.Don't...

View Article


Gem works in IRB but not Rails console

I am trying to use the Hubspot API Ruby gem located here https://github.com/HubSpot/hubspot-api-ruby#installation, but I am having issues with Ruby on Rails.For all of my other gems, I can just simply...

View Article

How do I remove Permission denied @ rb_sysopen - Gem install error?

I am trying to install create a new app in Ruby on Rails and I cannot get passed this error:$ gem install pgERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen -...

View Article

ActiveSupport::MessageVerifier::InvalidSignature:...

Before migrating to rails 5 it was working nicely, but when I migrated to rails 5.1.1 it is giving me error like ActiveSupport::MessageVerifier::InvalidSignature:...

View Article

Ruby on Rails bulk import

https://github.com/bodrovis-learning/RailsSeriesYT/blob/lesson_11/app/services/user_bulk_service.rb line 15 and 26def callZip::File.open(@archive) do |zip_file| zip_file.glob('*.xlsx').each do |entry|...

View Article


Error: SyntaxError: Unexpected token '

basically I'm using stimulusjs in ruby ​​on rails to create an ecommerce, and I'm trying to assign the stripe to my application (remembering that the functionality is on the cart page), but basically...

View Article

Image may be NSFW.
Clik here to view.

Rails_Admin issue on rails 7.1.3

I have updated a rails 5.0 to rails 7.1.3 apps. I have made the choice to use jsbundling insteead of importmap, as it seems easier to handle my existing javascript file.Now when I test the admin...

View Article


Streaming data in Ruby net/http PUT request

In the Ruby-doc Net/HTTP there is a detailed example for streaming response bodies - it applies when you try to download a large file.I am looking for an equivalent code snippet to upload a file via...

View Article

Image may be NSFW.
Clik here to view.

Could not find gem 'rails (= 4.2.5) x86-mingw32' when running rails server

I'm trying to learn Ruby on Rails.Currently been trying out Rails framework. I've installed it. Create new project in MyBlog folder, but when I try to run:rails serverI get back an error:Could not find...

View Article


Removing a model in rails (reverse of "rails g model Title...")

rails g model Rating user_id:integer message:string value:integerHow can I completely remove this model? Thanks

View Article

ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load...

I am trying to run this below code, then I got code error:ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- selenium-webdriver (LoadError)I am not able to find...

View Article

How to run multiple vagrant box instances from a same file with a port...

I'm trying to launch 2 boxes from one vagrant file using a loop. It's working, but until I try to add a port forwarding to it.I never was programming using Ruby before and I'm not super advanced using...

View Article
Browsing all 4616 articles
Browse latest View live


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