Questions tagged as 'ruby'

1
answer

Ruby - How to hit the LOAD_PATH at development time?

First of all: I'm a beginner in Ruby. I have a Ruby project that obeys the design pattern of the vast majority of projects. Therefore, the main executable is in bin /. bin/exec lib/ | -- library.rb -- library/ The problem i...
asked by 04.07.2015 / 05:15
1
answer

Gem :: LoadError Specified 'mysql2' for database adapter, but the gem is not loaded. Add 'gem' mysql2 '' to your Gemfile

This error appears constantly, in my case, I installed ruby, gems, rails, mysql2 all right. But when I tried: rake db:create Another error appeared: Gem :: LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. A...
asked by 15.09.2015 / 17:52
0
answers

Rails does not install on CentOS

I'm running a VPS with CentOS running, and I can not seem to get out of this error: [athos@athoscastro bin]$ gem install rails Fetching: nokogiri-1.6.6.2.gem (100%) Building native extensions. This could take a while... ERROR: Error installi...
asked by 17.08.2015 / 03:03
2
answers

Advanced Query in Ruby On Rails (ActiveRecord)

I need to do a query for a report something like this: Produto.include(:clientes).where('count(produto.id) < cliente.quantidade') In sql it would look something like this: SELECT C.NOME, C.QUANTIDADE, COUNT(P.ID) FROM PRODUTOS...
asked by 29.06.2015 / 16:53
2
answers

Rails does not accept request

I have a simple API in Rails, it only reads the database, and returns the JSON according to the request. However, I was testing the API, making a request with another device, connected via wireless, and I was not able to get JSON in response....
asked by 15.05.2015 / 13:59
0
answers

Undefined method 'map' for nil: NilClass

I'm having this problem if the validator encounters any errors after submitting the form. I think that may be why my instance variable, @users, is nil? I wrap it in the controller with the before_action, so should not have this problem, corre...
asked by 17.04.2015 / 13:24
1
answer

Template error no rspec-rails

I'm using rspec-rails to test my application, however when testing a view that uses Ransak for filters I get the following return error: 1) admin/cities/index renders a list of admin_cities Failure/Error: render ActionView::Template:...
asked by 23.04.2015 / 20:25
0
answers

Problem with executing commands

Currently I'm doing some tests with the execution of commands through the mouse and with loops, see below: if $MouseOnEvent == -1 if @teste == 1 print "test" @teste = 0 end end if $MouseOnEvent != -1 @teste = 1 return end...
asked by 27.04.2015 / 00:03
1
answer

Load skrollr.init in the correct way in Rails

I'm using Skrollr in a Rails application as follows: Gem Used: gem 'skrollr-rails' app / assets / javascripts / application.js //= require jquery //= require jquery_ujs //= require turbolinks //= require bootstrap //= require skroll...
asked by 06.05.2015 / 19:08
1
answer

call variables from another definition and continue

I have some variables that repeat a lot and would like to group them into one definition, to be called by several other definitions. Example: module Andre module Dialogos def self.um puts "estou em um" self.dois #chamar t...
asked by 02.06.2015 / 06:12