Questions tagged as 'ruby'

0
answers

IDE or Gem Arcadia pulls error [Windows 7]

I had the following problem once the gem arcadia was installed when I write to the Windows console (CMD): Arcadia requeri ruby-tk extension and tcl/tk run-time you must install before run. ----- LoadError Details ------------------...
asked by 31.10.2016 / 14:03
2
answers

Search through a query

I am doing a search engine for my application, it is a search form that handles two parameters: by Route and by Product, but the user can place a parameter or can place both in the search, my problem is that if the user selects one parameter, th...
asked by 13.12.2016 / 02:52
2
answers

Perform calculations in rails

Good I am new in rails I have the following doubt. If I have a product model with cost and price, how would I calculate the price depending on the cost? The serious price, cost * 30% Is it done in the model or the constructor?     
asked by 01.11.2016 / 14:18
1
answer

How to collect all the image tags from an html page on RUBY

My program collects all redirection addresses but I could not do the same with the image tags require 'nokogiri' require 'net/http' pagina = Net::HTTP.get(ARGV[0],ARGV[1]) enlaces = Nokogiri::HTML(pagina).xpath('//a[@href]')....
asked by 06.11.2017 / 14:55
1
answer

Specify Bundler versions in the Gemfile

A build of my project in TravisCI failed because Travis decided to use a version of Bundler (1.6.9, I think) that does not support blocks in source , like this: source 'https://rails-assets.org' do gem 'rails-assets-urijs' end Witho...
asked by 22.01.2016 / 21:21
1
answer

How to consume the Spotify API in Ruby on rails 5.2

Working with the Spotify-API in Rails I'm using Rails 5.2.1.1 ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] As of version 5.2 of Ruby on Rails, some improvements in the sections of security . To connect the Spotify AP...
asked by 04.12.2018 / 06:20
2
answers

Variable that traverses the for is not updated

I am trying that when the for exterior% completes an iteration, the variable i is updated, in the way that is indicated in the if after the for internal ( if i+self.nGroups > n ) for i in 0..n for j in 0.....
asked by 27.07.2017 / 20:49
1
answer

recommendations for the proper use of querys

I'm using a query to search for records, I have two tables, one is "sale" and the other is "detallevet" (this refers to the details of the sale) by this query I proceed to do the search of sales in their corresponding model def self.busqueda...
asked by 18.12.2016 / 22:06
1
answer

In Ruby what is the difference between using def and define_method?

I understand that define_method creates a method dynamically, but ... in which cases would you use it? What is the 'advantage' or what is different in the use, about creating a simple method with def ? Please do not quote refe...
asked by 07.09.2016 / 12:16
2
answers

Error using 'bundle install'

I will use a Style Guide, on its GitHub ( link ) says to install it you must do the following: git clone [email protected]:lonelyplanet/rizzo.git && cd rizzo cp .ruby-version.example .ruby-version cp .ruby-gemset.example .ruby-gemset cd ....
asked by 14.04.2017 / 18:05