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

How to set ExecStart for Puma service for a Rails app (rvm)?

I am trying to properly configure the setup of my puma service, but still unsuccessfully. My nginx.conf looks like this:upstream puma { server...

View Article


Ruby : Nested Hashes

Can anyone please explain what this bit of code does in Ruby ?x = ->(h, k) { h[k] = Hash.new(&x) }@abc = Hash.new(&x)I have searched and couldn't figure out what is exactly happening there.I...

View Article


Nested Ruby Hashes in Python

Can anyone please explain what this bit of code does in Ruby ?x = ->(h, k) { h[k] = Hash.new(&x) }@abc = Hash.new(&x)I have searched and couldn't figure out what is exactly happening there.I...

View Article

Getting Error - ActionController::UnknownFormat in...

Input ImageI'm encountering a "406 Not Acceptable" error in my Stimulus controller's fetch request. The controller is responsible for making an AJAX call to an endpoint, but it seems the server is...

View Article

bash: apt-get: command not found in bitbucket pipeline

I've been trying to build a pipeline to test my deploys in bitbucket but i keep getting this problem+ apt-get update && \ apt-get install -y \ fonts-liberation \ libasound2 \ libatk-bridge2.0-0...

View Article


ruby-doc.org says Ruby's WIN32OLE class is in win32ole/lib/win32ole.rb and...

According to the ruby-doc.org documentation on the WIN32OLE class (https://ruby-doc.org/stdlib-2.5.1/libdoc/win32ole/rdoc/WIN32OLE.html#method-i-methods), at the very top of the page on the left it...

View Article

How to resolve permission denied @ rb_sysopen

I am writing a simple recipe to create a file:file '/myfile' do content 'Welcome to Technical Guftgu' action :createendBut on chef-client -zr "recipe[test::recipe1]" I am getting the the following...

View Article

Transforming text to bold in ruby

I have both controller and view for a simple game I've created.This is my function :def score @letters = params[:letters] @word = params[:word].upcase if !compsrison?(@word.split(''), @letters.split)...

View Article


Windows 10 + Ruby 3.1.2 -- Cannot install nokogiri

I am quite new to development and just trying to set my Windows 10 PC up for Rails development. I found a tutorial that seemed quite clear and achievable here.I was able to install Ruby 3.1.2 and...

View Article


How to factor out code into methods in a Ruby script while retaining access...

Suppose I have a Ruby script like the following to generate YAML describing a list of services:require 'yaml'environment_slug = ENV.fetch('CI_ENVIRONMENT_SLUG')YAML.dump([ {'name' =>...

View Article

Error encountering upon executing CLI "gem install rails"

I'm newbie on ROR. trying to set up a local development and study.I already have ruby dev kit which i install from rubyinstaller.org (Ruby+Devkit 3.2.3-1 (x64))here is my ruby version -> ruby 3.2.3...

View Article

How can I update my method using an alternative update method in ruby on rails?

Is it possible to update from an action/method other than the update action/method? For example in my users controller I already have an update method for other parts of my users account.I need a...

View Article

Rails - Multiple top level domains and a single session/cookie

I've been struggling with this for quite awhile and haven't been able tofind a solution. I need a user to be able to view multiple top leveldomains with a single login.My understanding is that this...

View Article


How can we update the headers to pass parameters in ruby on rails [closed]

here is my controller method ,but when commiting if params[:commit] == "パッケージチェック"I want to pass the params as request body not through url, which has resulted in 404 with an error messageupstream sent...

View Article

How to set time zone in Rails 5.2 to 3:30 instead of 4:30 for Iran

It has been 2 years since the time in Iran hasn't changed during the spring. It used to change from 3:30 to 4:30 in the first of spring, but these years, it hasn't changed. So, I want my time zone to...

View Article


How can I write a custom cop in Rubocop for dealing with one-line class...

Is it possible to write a custom cop that would call out class definitions like this:MyError = Class.new(StandardError)And advise the author to format it like this?class MyError < StandardError; end

View Article

Dynamic Header with prawn gem

I'm encountering an issue while rendering a header with the report_date argument passed into the render_header method. Despite passing a different report_date value each time, the PDF always displays...

View Article


Error when sending invitation with Devise_invitable

I know there's some threads about this but, from what I saw they are quite old and can probably be outdated.I'm using devise and devise_invitable. The idea behind it is to allow admins and teachers to...

View Article

Error loading RubyGems plugin ".../plugins/yard_plugin.rb": cannot load such...

I got:Error loading RubyGems plugin "/Users/dorianmariefr/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/plugins/yard_plugin.rb": cannot load such file --...

View Article

devise token auth find user with password reset token

I'm using devise token auth and I'm setting up password reset process. When I click the reset link in the email, it has the url parameter reset_password_token=hK3yxC1zVZCbWL8WgqKM but when in the rails...

View Article
Browsing all 4633 articles
Browse latest View live


Latest Images

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