Questions tagged as 'ruby'

1
answer

Error installing Sass on Mac / Error Installing sass on Mac

Running the command gem install sass shows me this Result of the console, if anyone knows the solution or an idea of why this is happening I would appreciate it. Building native extensions. This could take a while... ERROR: Error inst...
asked by 20.02.2018 / 15:56
0
answers

Problem with accepts_nested_attributes devise rails 5

I am implementing a user registry with Devise 4.3.0 in Rails 5.1.3. Each user belongs to a Community and if the name of the community is provided in the registry a new community must be created next to the user. The models: class User <...
asked by 07.02.2018 / 12:22
1
answer

How do I run a series of hashes inside an array and verify its contents?

Good afternoon friends of stackoverflow. I have my next question in rails I have the following hash inside an array. @permissions_crud_hash = [:name => name_, :c => c, :r => r, :u => u, :d => d] @permissions_crud.push @perm...
asked by 31.01.2018 / 15:15
0
answers

How to use Ruby 2.2 in OpenSuse 42.3?

Hi, I need to use the Ruby tk library, but the default edition of Opensuse is Ruby 2.1, I used yast to install the library but I installed tk for Ruby 2.2 next to the same edition. Now I have two editions of Ruby (2.1 and 2.2), but the termin...
asked by 12.01.2018 / 17:32
1
answer

Problem in reading file ruby on rails

Any idea why you give this error? No such file or directory @ dir_initialize - /lib/oc/ I have several txt files in that folder my code reads any .txt file and then I use it to analyze it. Dir.foreach('/lib/oc/') do |item| next...
asked by 07.12.2017 / 15:05
1
answer

What is the easiest way to generate a view that shows me the headings and the details ruby on rails

I would like to get the details of a header and I have them all related, I just need to show them in the same view, try to add it but it says undefined method cod_prod for nil:NilClass <p id="notice"><%= notice %></p>...
asked by 01.12.2017 / 15:49
1
answer

carrierwave when editing does not find the route

I'm using the gem Carrierwave to upload pdf ; is working correctly when creating, but the drawback is when editing, if I save it takes me to show and I get the following error:    No route matches [POST] "/ client / 5" (example)....
asked by 15.12.2017 / 00:30
1
answer

cycle foreach and next if a condition is met help in ruby on rails

Cycle foreach and next if a condition is met, I am analyzing a line in a txt and I want to verify if the next line complies with a pattern to do one thing and if not to do something else. Example: next if line.include?("UNSS...
asked by 14.12.2017 / 15:39
1
answer

Error rendering a partial of a controller from another controller

I am trying to render a table of records for a Orders controller in another controller called Dashboard . I've read a lot about doing it with: <%= render 'orders/index'%> And it throws the following error: The current code...
asked by 27.11.2017 / 18:46
1
answer

Read any extension .txt file inside a specific folder in ruby every 2 minutes

I want to read every 2 minutes all the files one by one from an example folder C: \ folder \ all those that have a txt extension. but I do not know the names of each file because they are random. after reading it would be convenient to eliminate...
asked by 30.11.2017 / 14:27