Most voted "ruby" questions
Ruby is a dynamic, interpreted, object-oriented, cross-platform, open-source language created by Yukihiro Matsumoto (Matz) in 1995. The [ruby] tag is for issues related to the Ruby language, including its syntax and its libraries. Specific questions about the Ruby on Rails structure should be marked with [ruby-on-Rails] and not [ruby].
Learn more…679 questions
Sort by count of
-
-1
votes1
answer73
viewsHow does the loops and variables in Jekyll work?
When I compare in if if the post.category it’s like there’s no post variable that’s in for more when I put {{post.category}} it prints the name. It’s like in if he wouldn’t exist anymore if I put…
-
-1
votes1
answer1134
viewsRuby installing Opencode GEM (Tray)
I’m new to Ruby, and a client wanted me to create a template using famashop http://www.tray.com.br http://dev.tray.com.br/hc/pt-br/articles/206159587-Iniciando-um-tema I am following the developer…
-
-1
votes1
answer264
viewsClass Person > Legal person > Natural person. Rails 4
I’m developing a APP in Rails, and I came up with the following question regarding the class Person. The structure of these classes are like this: Pessoa { tipo, status } PessoaJuridica {…
-
-1
votes2
answers300
viewsHow to delete a BD data from the Ubuntu terminal? Ruby on Rails
I scaffed the Rails... okay. Now I’m using Gem paranoia to give a software delete, but that’s it, how do I give the command for example this, in a post mine? Which way...
-
-1
votes1
answer497
viewsWhat is Ruby for "ensure"? Give an Example
What is "ensure" for in Ruby? Give a Practical Example in which situations it is useful. I’m studying this site here: tutorialspoint.com/ruby/ruby_exceptions.htm But it’s not very clear about…
rubyasked 6 years, 7 months ago user110265 -
-1
votes2
answers92
viewsDoes Python Command Exist Similar to (Catch and Throw) Ruby?
Exists in Python Similar to Ruby (Catch and Throw)? I’d like to jump like this: a = 10 throw :pularparaaqui if a == 10 catch :pularparaaqui do end
-
-1
votes1
answer443
viewsrvm installation on windows 7
It is possible to install rvm or rbenv in windows 7, for controlling versions of ruby and Gems. If it is possible how do I install on my machine? ... I have already followed several tutorials that…
-
-1
votes2
answers92
viewsReturn the Fibonnaci elements from the term passed to the first
I have made the return of some specific elements already, but I am trying to return up to the first. In the code below I returned a certain element, as I create from now until the first, until the…
-
-1
votes1
answer49
viewsDoubt when returning the amount of different letters
I would like to return the amount of different letters between the two strings, in this case the different letters are "TACG" and "ARGC", soon would have to return 4. ruby def letras(string_1,…
rubyasked 5 years, 5 months ago Bruno Rodrigues 25 -
-1
votes1
answer116
viewsPATCH and PUT Rails
I am doing a test for an internship where I have an api and in this api I have to have the PUT method to change a user’s data by the id and a PATCH method that changes the partial data of a user but…
-
-1
votes1
answer38
viewsI’m having trouble importing a ruby file
I am trying to import a ruby file using require and the require_relative but I always get this mistake Traceback (most recent call last): 1: from app.ruby:1:in ' app.ruby:1:in require_relative':…
rubyasked 4 years, 6 months ago Alexandre Lyforth Fernandes 1 -
-1
votes1
answer12
viewsRuby Gem carrierwave-ftp in Heroku returns Net error::Ftppermerror (500 I won’t open a Connection to
I am using Gem carrierwave-ftp and dev localhost works normal but in Heroku it resumes the error below: Net::Ftppermerror (500 I won’t open a Connection to xxx.xxx.xxx (only to zzz.zzz.zzz. ) Below…
-
-1
votes1
answer132
viewsUndefined method `+' for nil:Nilclass - Ruby on Rails
I need help to solve this problem: Undefined method `+' for nil:Nilclass - Ruby on Rails #contabilização de todos os contratos @stat['RCS'] = {} produtos.all.each do |ps| if not…
-
-1
votes1
answer41
viewsSubtraction between elements in Ruby array
Hello, I have an array of values: values = [3, 5, 12, 1, 2] I would like in the first iteration all elements of the array to be subtracted by the first element (Ex, 5-3, 12-3, 1-3, 2-3) # [2, 9, -2,…
-
-1
votes1
answer20
viewshow to save data from an api with ruby and sqlite3
I’m creating an app only in ruby, with sqlite 3,I have to create the bd in bin setup to save the parameters of the api,I’m trying to make this foma: #!/usr/bin/env ruby require 'sqlite3' require…
-
-1
votes2
answers142
viewsBUILD FAILED (Ubuntu 20.04 using ruby-build 20210420) - Ruby year install error using asdf
When trying to install ruby by asdf with the command: asdf install ruby 2.7.2 I get the result: Downloading ruby-2.7.2.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.bz2…
rubyasked 3 years, 9 months ago Rogério Feliciano 1 -
-1
votes1
answer20
viewsLoop Redirect Error in Rails application
I am working on an application in Rails and doing tests via Postman, the application usually works normally after having logged in some user, I can test the endpoints correctly. But when I stay with…
-
-2
votes1
answer146
viewsWhen to use `for x in y`and when to use `each`
In my other question I figured out the difference between for x in y and the method each. Now, I ask, when should I use each of them? Could give some examples of cases where one should use one and…
-
-2
votes1
answer151
viewsError while initializing Redmine
After making the modification in one of my plugins in development in Redmine , it can no longer initialize and returns me the following message: ActionView::Template::Error (can not load…
-
-2
votes1
answer181
viewsHow to cover testing in Rails applications already completed?
TDD is usually used during development. But what about when you walk into a company, get the code all messed up and see the urgent need for improvement and of course, test coverage? How to proceed?…
-
-2
votes1
answer398
viewsCreate system access levels
Guys, this question starts from scratch. I want to know how to determine system access rules where there are 3 types of profiles: general administrator, local administrator and maintainer, where…
-
-2
votes2
answers555
viewsHow to use for in Ruby?
I can’t use the for equal use in the Java. I am trying to find out if a die is addicted. An honest casino owner launched it n times, given the n Launch results, determine the number of occurrences…
-
-2
votes1
answer49
viewsHow do I accept only letters in the Ruby entry?
Given a string, you have to take only uppercase and lowercase letters. And in the output show them. How can I achieve this result?
-
-2
votes1
answer34
viewsSass::Syntaxerror - Properties are only allowed Within Rules, Directives, mixin includes, or other properties
When trying to access the site, this error appears: Properties are only allowed Within Rules, Directives, mixin includes, or other properties. https://pastebin.com/LqMyVEM5 (Sass file code) My…
-
-2
votes1
answer172
views400 Bad Request "Forbidden"
I am testing Jasmin through demo version and already created the application and corresponding subscription in Nitrogen. Through the Postman examples of the Github repository, I can already get the…
-
-2
votes2
answers120
viewsRails API Using Gem PUMA Development Environment >> Production
I have developed an API that connects in an oracle database is working properly in development, but when I try to run the GEM Puma in production, it gives error. command to execute *** SIGUSR2 not…
-
-2
votes3
answers108
viewsReturn error message when split by 0 - Ruby
All right? I’m doing a challenge on Ruby and the def’s need to be the way it is in the code I’m gonna send. The division by 0 needs to return with the message "Oops! Zero as divisor" I’ve been…
-
-3
votes3
answers113
viewsRest of division in ruby
I have a array of values: values = [2, 7, 15, 11, 5] I would like to take only the values that divide between them give rest '0' (return 15 and 5). I’m getting it this way, but the code will read…
rubyasked 3 years, 10 months ago Jair Silva 11 -
-3
votes1
answer38
viewsI am not able to solve this error of syntax,
class Sale < ApplicationRecord belongs_to :client belongs_to :user belongs_to :discount has_many :product_quantities has_one :comission after_save do calc = 0 # Soma o preço dos produtos vezes a…