Questions tagged as 'ruby'

1
answer

How to subtract two dates using Ruby and the Time library?

This is the code: require 'time' t = Time.parse('2016-04-18') #data de ontém t2 = Time.now #data atual t3 = t2 - t # subtração das duas variáveis(datas) acima puts Time.at(t3) #resultado da subtração In this case the result should be a day...
asked by 19.04.2016 / 16:08
1
answer

Error installing rvm requirements

This error occurs for the two things I tried: 1 - install ruby and from there, install rvm requirements. Error running 'requirements_debian_libs_install gawk libreadline6-dev libyaml-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake li...
asked by 28.04.2016 / 21:13
0
answers

Split by Ruby uppercase

How can I use split to separate the words in the phrase "QueroSepararAsPalavrasNestaSentença" in ruby?     
asked by 16.04.2016 / 16:45
1
answer

require command does not work in gem for ruby

I installed Ruby , RailsInstaller and RubyDevKit on the C partition (eg c: \ Ruby23-x64). Execution in cmd    ruby -v Theversionofrubyinstalledwithnoproblemsappears.Execute  geminstallpipedrive-rubyandalsoinstallswithoutproblems,...
asked by 13.05.2016 / 05:56
1
answer

Error setting up Ruby on Rails environment

Good afternoon, folks. I'm learning Ruby on Rails in college and to practice at home I'm trying to install and configure the environment on my pc, but with no success. I installed NetBeans and MySQL Server and when I create a new Ruby on Rails p...
asked by 18.03.2016 / 19:26
1
answer

How to nest step definitions inside another using Cucumber

I would like you to help me resolve this, I am trying to reference a step definition within another in the same file to avoid repetition of code, of course if this is possible. Example Dado /^escolho a letra (.*) $/ do |letter| # al...
asked by 26.04.2016 / 02:59
1
answer

Create just too much relationship for many in Ruby

I have a very close relationship with the entities yell and category: model yell.rb class Yell < ActiveRecord::Base belongs_to :user, inverse_of: :yells has_and_belongs_to_many :categories def as_json(options={}) super(:only =...
asked by 27.01.2016 / 13:27
2
answers

How to do rewrite correctly in Nginx?

I'm having trouble configuring Nginx as a reverse proxy in an application. It is a Rails application, which runs on unicorn. In this case, I have the link domain. Instead of creating a subdomain, I'd like link to be the root url and direc...
asked by 24.02.2016 / 22:52
0
answers

How to get the value of a field from another table with ruby on rails

Hello, the question is this: I have classes that use data from other classes, I need them to load the values registered in those other classes, show this in an html page. This is the structure of a class that receives data from other classes....
asked by 04.03.2016 / 15:40
1
answer

Admin View Ruby on Rails

Next I created a site using Ruby on Rails and the Devise and Pundit gems. Users have a role that can be Analyst, Developer or Administrator. I am using a View to list all users registered to the admin. This is my Controller :...
asked by 13.11.2015 / 13:28