ruby tag

542 questions


1 answers
46 views
0
rails server error

I am developing at rails.An error occurred when I tried to boot to rails server.How can I solve this problem?I would appreciate it if you could reply.=>Booting Puma=>Rails 5.1.5 application star...

2 years ago

1 answers
40 views
0
How to write search scope where

I am currently creating a search form on scope.I want to search for multiple columns from two models and one model, but I don't know what it says.Currently, I can search for one column for each of the...

2 years ago

3 answers
124 views
0
Is there a way to free up the real memory that Ruby's process is holding?

Ruby's scripts are struggling with the phenomenon of keeping memory if it ever gets huge.require 'objspace'array=[ ](1..20).each_with_index do|i| array<<'a'*1000000 puts memsize:#{ObjectSpace.me...

2 years ago

2 answers
116 views
0
Ruby Array Operations Questions

We have the following data that we grouped by date in Ruby.{[2021, 12, 28, 1]:2, [2021, 12, 28, 2]:2, [2021, 12, 28, 3]:2, [2021, 12, 28, 4]:4, [2021, 12, 28, 7]:2, [2021, 12, 28, 5]:1}I would like to...

2 years ago

1 answers
42 views
0
A site with lots of ruby on rails sample codes.

Sample rails code I'd like to practice hitting hard.Sites with lots of rails sample codes Do you have any books?I looked for it, but I couldn't find it because I wasn't good at finding it.I would like...

2 years ago

1 answers
46 views
0
In the case where the controller and Ability target are different, such as DashboardController, in the CANCAN gem, it does not work, and it becomes an uninitialized constant Dashboard.

in a Dashboard Controller, where you want to view a list of users, etc.uninitialized constant dashboardThe error appears.I'd like to make the cancellation work even if the controller and Ability targe...

2 years ago

1 answers
39 views
0
Understanding Counts by Ruby Branch

Using X as a variable, +1or-1 is added according to the conditions of の, and when the bias of X becomes +5or-5, it is shifted to or or に.Also, I would like to write a code saying that it will be reset...

2 years ago

3 answers
52 views
0
I'm doing rails-tutorial.AWS reports a Blocked host: error.

I am a programming beginner doing rails-tutorial.As I proceeded with the tutorial, I received a Blocked host: error on the AWS server.You want to know how to resolve this error.I will write the detail...

2 years ago

2 answers
42 views
0
I want to change the file name in the zip file.

#zip filenamezip_file_name = test.zip# zip file pathzip_file_path = File.join Rails.public_path, zip_file_name# a file to be included in a zip filefile=xxxxxxx/xxxxx/test.txt`zip-jm#{zip_file_path}#{f...

2 years ago

2 answers
52 views
0
I want to run multiple SQL statements in Mysql2::Client

I want to read the text file sql.txt with the ruby statement and run it in mysql2, but it doesn't work.#DB Settingsdb=Mysql2::Client.new(...)# Loading sql Statementssql = ' 'File.open(./sql.txt, r) do...

2 years ago
« - 27 - »

© 2024 OneMinuteCode. All rights reserved.