Questions tagged as 'ruby'

1
answer

validate 24 hours rails

validate :prueba def prueba self.hora_pedido = Time.zone.now.strftime("%Y-%m-%d-%H:%M:%S" ) if ( hora_entre - ( 60 * 60 * 24 ) ) < ( hora_pedido ) errors.add(:hora_entre, "hora no válida") end end validate hora_entre...
asked by 20.06.2017 / 22:10
1
answer

Do not add the second hash to an array

I am creating an array of hashes that are automatically added with a input , the problem is that when I want to add a second user it deletes the data from the first one . people = {} data = [] puts 'Write your name' name = gets.chomp.capit...
asked by 08.07.2017 / 21:43
1
answer

what am I doing wrong when generating my server https with ruby in kali?

Turns out I'm trying to mount a https web server and when I try it I get an error, the code is as follows: with this code generate the certificate: require 'webrick' require 'webrick/https' cert_name = [ %w[CN localhost], ] server = WEBri...
asked by 22.06.2017 / 12:20
1
answer

Rails does not start server in Ubuntu

I am starting to use Rails, and I can not raise the server with the rails s command, I have installed rails 5.1.1 and until a couple of days ago everything worked fine, but now it sends me the following error every time I try to start it:...
asked by 02.06.2017 / 01:52
1
answer

chainselect ruby on rails, problem with javascript [duplicate]

I try to make a select with a form. Form <%= simple_form_for(@persona) do |f| %> <%= f.error_notification %> <div class="form-inputs"> <%= f.input :identificacion %> <%= f.input :nombre %>...
asked by 07.06.2017 / 16:50
1
answer

Error trying to install ruby with rbenv install 2.3.3

I'm trying to install ruby on rails on ubuntu 16.10 by using the rails go guide but by placing the rbenv command install 2.3.3 I get the following error: Downloading ruby-2.3.3.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2...
asked by 14.05.2017 / 04:55
1
answer

Save data to a csv file

I need to save my data from the Rails database in a CSV file. I followed the steps in this post: link But when you do everything as you put it there, when opening in the browser I see this error: 500 Internal Server Error If you are t...
asked by 17.05.2017 / 12:00
1
answer

The action 'report' could not be found for MedicalRecordsController

The following happens, I have this in the routes: resources :professionals do #... resources :medical_records, controller: 'medical_records', only: [] do collection do get :report end end end And the...
asked by 17.04.2017 / 23:22
2
answers

Error when bundling rails

This is what the console throws at me: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw...
asked by 04.04.2017 / 02:05
1
answer

Error executing 'rails s'

At the moment of wanting to raise the server service, it gives me this: rails s => Booting WEBrick => Rails 4.2.6 application starting in development on http://localhost:3000 => Run 'rails server -h' for more startup options => Ctr...
asked by 04.04.2017 / 03:18