Questions tagged as 'ruby'

0
answers

Error installing package or updating Ruby Gem

Hello! When I apply any command gem install qualqueroutragem or gem update --system this type of error occurs:    "ERROR: While executing gem ... (ArgumentError)       wrong number of arguments (given 1, expected 0) " H...
asked by 24.11.2018 / 13:06
0
answers

Errors in Ruby appear because?

Goal Add (uri, url) with port. # Ajuda por carlos-romero # https://stackoverflow.com # Ajuda por mu-is-too-short # https://stackoverflow.com require 'uri' require 'socket' url = 'file://C://' class Class1 def fileProtocol( ur...
asked by 21.11.2018 / 21:43
0
answers

How do I send the typing indicator for time-consuming Stealth tasks?

Hello, I would like to know if there is a possibility to send the typing prompt in Facebook Messenger for tasks that sometimes take a while to send the result. The user ends up feeling that the bot is not working or sends a message later fo...
asked by 07.11.2018 / 13:55
1
answer

Method returns me as null value

When I create my code below, it returns me this error message, saying that my method is undefined for nil (undefined method 'errors' for nil:NilClass) Code: <ul> <% @task.errors.full_messages.each do |message| %>...
asked by 15.10.2018 / 16:21
4
answers

Fibonacci Sequence

I'm doing selective process, and they are asking me to create a Fibonacci sequence, I just do not know how to create, until I tried (code below) but did not get results. I have to return the F (0) element of the Fibonacci sequence. could anyone...
asked by 15.10.2018 / 18:47
1
answer

Identify number in the array and change to a string

I'm trying to change divisible numbers by 3 for a word within my array . I tried to add my if within array and with no result. def code( n ) if n % 3 == 0 Array.new(n + 1) { |i| i } end     
asked by 17.10.2018 / 12:48
0
answers

rvm1scripts / rvm-auto.sh: not found, but the file exists on the server

I'm using Capistrano to deploy my rails application on an AW2 EC2 server with Ubuntu. When you run the assets: pre-compile command, it returns an error that the /var/www/apps/xxxx/rvm1scripts/rvm-auto.sh file was not found, but accessing the ser...
asked by 19.10.2018 / 20:43
2
answers

Rendering a JSON object with the join of different models

I'm developing an API with rails 5 and I have the following models: class cotacao < ApplicationRecord belongs_to :usuario has_many :cotacao_itens, dependent: :destroy accepts_nested_attributes_for :cotacao_itens, allow_destroy: true...
asked by 05.10.2018 / 20:18
2
answers

Ruby on Rails Modeling

I have a question that I can not see how to resolve. I have to run a stock program in Ruby on Rails that contains some hardware, which will contain some insights. For example, I will have computers, printers, phones, among others, each wit...
asked by 04.10.2018 / 17:55
1
answer

Request via Ajax not returning filtered data

I am trying to return data via Ajax to load a select of states in Rails, so that only returns the states that belong to a given Country, but the return never arrives in the conditional, always to the parse of the JSON that I'm requesting from th...
asked by 08.10.2018 / 22:38