Prutheus

Activity Graph

Page 1 of 2 | Next »

2018-06-03

[17:03:41] Prutheus: has joined #RubyOnRails
[17:04:47] Prutheus: Hello. I have a rails application. There, in the directory /public/images/ I have some images which i want to use on my html site. But I cant access them, when I request the path in my browser, i get No route matches [GET] "/public/images/test.png
[17:04:50] Prutheus: how to solve that?
[17:11:26] Prutheus: Quit: Page closed

2018-05-26

[22:25:58] Prutheus: has joined #ruby
[22:26:50] Prutheus: Hello. I am using selenium-webdriver with the chrome driver on my ruby project. I want to use http proxies to make my browsing anonymous. I use that setting for it: https://bpaste.net/show/acc224f63f2d but for some reason, the driver does not have the ip of the proxy, instead it has the server ip ... why?
[22:26:57] Prutheus: Why is my proxy not working via that method?
[22:41:14] Prutheus: Quit: Page closed

2018-05-21

[13:08:47] Prutheus: has joined #RubyOnRails
[13:09:20] Prutheus: Hello. I want to use the gem 'easy_captcha' in my rails app. But after setting it up, I get following error when navigating to any site defined in my routes: `undefined method `after_filter' for ApplicationController:Class Did you mean? after_action`
[13:09:30] Prutheus: How can I fix that stupid error?
[13:11:41] Prutheus: hm but I dont want/cant edit the whole gem ... any idea how I quickfix that? or do you want to update the gem? :) ^^
[13:16:52] Prutheus: could you do that for me please? :D ^^
[13:27:06] Prutheus: Quit: Page closed
[18:44:02] Prutheus: has joined #RubyOnRails
[18:45:48] Prutheus: Hello. i am using scss stylesheet files. after editing, my page does not recompile them, so no update ... any ideas?
[18:49:42] Prutheus: Quit: Page closed

2018-05-13

[11:18:21] Prutheus: has joined #RubyOnRails
[11:19:56] Prutheus: Hello. I am using sidekiq. I have a model called Search where search requests on data gets queued. Now I have a scheduler which should iterate every second over all searches and check if they should get executed. For that, my scheduler is a sidekiq job with a inf loop where it reuqests all Searches: searches = Search.all ...
[11:20:26] Prutheus: My problem is, that when I update a search outside the scheduler, it still has the old data in the scheduler
[11:20:32] Prutheus: Do you need to check any code?
[11:30:51] Prutheus: Quit: Page closed
[16:53:46] Prutheus: has joined #ruby
[16:54:07] Prutheus: Hey. I have this array: newres = [{endTime: '2018-05-19T20:46:02.000Z'}, {endTime: '2018-06-08T21:27:26.000Z'}, {endTime: '2018-05-23T18:58:22.000Z'}]
[16:54:28] Prutheus: I want to sort the elements by their endtime's via newres.sort {|n| Time.parse(n[:endTime]).to_i }
[16:54:40] Prutheus: but this method is not sorting it at all...what am i doing wrong?
[16:56:53] Prutheus: Client Quit

2018-05-12

[11:28:25] Prutheus: has joined #ruby
[11:28:48] Prutheus: Hello. I want to exit an if block before reaching end if an condition inside the if block matches.
[11:28:57] Prutheus: how to break out of an if block? with break, it does not work
[11:35:12] Prutheus: nah, i jsut wrap the code inside the if into a labmda block where i can use break inside
[11:36:47] Prutheus: why should i not do that?
[11:37:49] Prutheus: but hwy is that bad code? https://bpaste.net/show/b66c5fada1e1
[11:39:46] Prutheus: but is my example ahrd to read? no
[11:39:50] Prutheus: its absolute easy and logical
[11:40:01] Prutheus: so i dotn know how else i should program that piece
[11:40:25] Prutheus: Quit: Page closed

2018-04-25

[09:41:30] Prutheus: has joined #RubyOnRails
[09:42:26] Prutheus: Hello. I am using sidekiq and want to use that method https://github.com/mperham/sidekiq/wiki/FAQ#how-do-i-cancel-a-sidekiq-job to cancel a job. But how do I call the cancel! method on the job, because when i do `job = TaskWorker.perform_async('bob', 5)` job is only the jid string ...
[09:46:46] Prutheus: Quit: Page closed

2018-03-24

[12:16:31] Prutheus: has joined #RubyOnRails
[12:17:18] Prutheus: Hello. I am working with RubyOnRails and Sidekiq with redis-server. I need to cancel jobs by their job_provider_id. I have no clue how I can do this and I could not find anything in the WWW about that what works, so could someone please assist me with that?
[12:18:21] Prutheus: I found that https://github.com/mperham/sidekiq/wiki/API
[12:19:09] Prutheus: And i have started a job, in my sidekiq log its 'started' and i have an id for it
[12:19:15] Prutheus: but Sidekiq::Queue.new.size tells me it has a size of 0
[12:19:19] Prutheus: so what am I doing wrong?
[14:01:25] Prutheus: Quit: Page closed

2018-03-09

[19:27:42] Prutheus: has joined #RubyOnRails
[19:28:46] Prutheus: Hello. I have the problem that my mailers get the stylesheet links as follows: `href="/assets/application.self-7d521695dc16dbb59ec7117a5de684d3fa886dd30dc298ad834365d3f069f572.css?body=1"` it comes from a call of ` <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>` but i need to have the full url with domain name, how is that possible to obtain?
[19:28:56] Prutheus: otherwise the mail shows no css styling
[20:06:39] Prutheus: but i am usign a lot of libs which provide stlyes which are getted from the stylesheet include tag, not able to hardcode them.
[20:06:46] Prutheus: what can i do"
[20:07:14] Prutheus: i mean the links are in the mail source, but just relative, like i posted, noit absolute with server domain
[20:07:24] Prutheus: i just need the server domain in from of it, then it would work
[20:24:48] Prutheus: beingjohnm: its not working :/
[20:29:36] Prutheus: Quit: Page closed

2018-03-05

[12:32:18] Prutheus: has joined #RubyOnRails
[12:32:46] Prutheus: Hello. I am using sidekiq for queue for ActiveJobs, I need to get a list of all current running jobs, how is that possible?
[12:37:41] Prutheus: Quit: Page closed

2018-03-03

[09:56:34] Prutheus: has joined #RubyOnRails
[09:58:07] Prutheus: Hello. I am on rails with mysql. I have some queries with a lot of data, very massive. But these queries do not get executed, or better: they get rolledback (Mysql2::Error: MySQL server has gone away)
[09:58:10] Prutheus: how to fix that?
[10:06:08] Prutheus: how to fix?
[10:10:56] Prutheus: hmmm holy thisis really not good :/
[10:11:48] Prutheus: any idea what i can do to fix that? no?
[10:13:18] Prutheus: okay i will check the logs
[10:13:39] Prutheus: the problem is that happens only at too big queries
[10:14:09] Prutheus: over 200000 characters
[10:15:35] Prutheus: a lot of data, storing text files which are getting uploaded with a lot of data
[10:15:42] Prutheus: what is batch inserting?
[10:15:55] Prutheus: how to find out max_allowed_packet?
[10:22:24] Prutheus: it worked now after setting max size new
[10:22:40] Prutheus: Quit: Page closed
[14:37:38] Prutheus: has joined #ruby
[14:39:25] Prutheus: I want to use talib-ruby .... I am on windows with 64bit ruby .... however, I need to install the talib c bindings first ... so i downloaded sourceforge.net/projects/ta-lib/files/ta-lib/0.4.0/ta-lib-0.4.0-msvc.zip/download , extracted it to C:\ta-lib and want to build my ruby gem now with gem install talib_ruby -- --with-talib-include=C:\ta-lib\c\include --with-talib-lib=C:\ta-lib\c\lib
[14:39:39] Prutheus: Problem: I get errors: talib.o:talib.c:(.text+0x43): undefined reference to `TA_CallFunc' (and some more)
[14:50:53] Prutheus: Quit: Page closed

2018-03-02

[21:52:11] Prutheus: has joined #ruby
[21:52:32] Prutheus: Hello. I want to build a gem (mysql2) on windows: gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:/Program Files/MySQL/MySQL Connector C 6.1"'
[21:52:57] Prutheus: But for some reason i fail with: Cannot find include dir(s) C:/Program/include
[21:53:03] Prutheus: why is the path not working like i set it?
[22:03:37] Prutheus: any idea how to quite it right?
[22:08:09] Prutheus: however i solved it
[22:08:24] Prutheus: but how can i pass such arguments in my gem file to bundler?
[22:09:00] Prutheus: qyliss: but how to use that method in rails then?
[22:10:35] Prutheus: hwoever how can i isntall it in rails?
[22:13:23] Prutheus: but bundler is fetching it and isntalling it
[22:14:33] Prutheus: so how let it using the local installed gem?
[22:15:12] Prutheus: does not exists
[22:16:08] Prutheus: if i leave it out of my gemfile it complains Gem::LoadError: mysql2 is not part of the bundle. Add it to your Gemfile.
[22:16:20] Prutheus: and if i put it in it installs the binary and not the working version i have compiled
[22:28:08] Prutheus: Quit: Page closed

2018-02-21

[22:23:31] Prutheus: has joined #ruby
[22:24:23] Prutheus: Hello. I have two arrays a = [[1,2],[3,4]] and b = [[5,6],[7,8]] and need a function which converts them to c = [[1,2,5,6],[3,4,7,8]]
[22:25:35] Prutheus: hm and how combined? i dont get it
[22:26:16] Prutheus: i dont get the rest, that is the problem :/
[22:26:33] Prutheus: not at least without a loop
[22:27:08] Prutheus: oh yeah i forget the map function so often :/
[22:27:41] Prutheus: yeah but not like i meant it
[22:30:31] Prutheus: Quit: Page closed

2018-02-19

[12:38:30] Prutheus: has joined #RubyOnRails
[12:39:16] Prutheus: Hello. I am working with active jobs. Inside the job's perform() function, i need to find out the job's job_id, how is this possible?
[12:48:15] Prutheus: Quit: Page closed

2018-02-16

[22:02:58] Prutheus: has joined #ruby
[22:03:39] Prutheus: Hello. Can someone explain me how this line `entries = entries.values_at(*(0...entries.length).step(2))` selects only 1,3,5,7th element and so on? I dont know what the * is doing and how that works
[22:12:12] Prutheus: okay. i still do not understand * ... ;(
[22:14:46] Prutheus: so it is like a .each loop?
[22:18:09] Prutheus: Quit: Page closed

2018-02-06

[20:41:38] Prutheus: has joined #ruby
[20:43:45] Prutheus: Hello. A Rails question: The application template has something like that `<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>` in it ... I also want to include all tempaltes and themes in the mailers template, but this line of code jsut embeds them relative, not absolute, so their path is /assets/.... and not https://www.domain.com/.....
[20:43:49] Prutheus: how to fix that?
[20:48:59] Prutheus: what do you mean? i do not know the path of it :/
[20:51:08] Prutheus: in the mail, from the usage of the code i showed you, there are some links generated like: `<link rel=3D"stylesheet" media=3D"all" href=3D"/assets/application.se= lf-596c2fa6c5d7dbf2dd37bac9a44f82d983db1a31b09c0518e0108a49324d666f.css?b= ody=3D1" data-turbolinks-track=3D"reload" />`
[20:51:33] Prutheus: but this link can not get resolved from my email client cause there is no web domain/ip given in front of the path
[20:53:16] Prutheus: the premailer looks great
[21:05:05] Prutheus: has joined #RubyOnRails
[21:05:11] Prutheus: Hello. A Rails question: The application template has something like that `<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>` in it ... I also want to include all tempaltes and themes in the mailers template, but this line of code jsut embeds them relative, not absolute, so their path is /assets/.... and not https://www.domain.com/.....
[21:05:15] Prutheus: how to fix that?
[21:31:34] Prutheus: Quit: Page closed

2018-02-05

[14:48:58] Prutheus: has joined #ruby
[14:49:14] Prutheus: mattwc: hello, you remember me from yesterday with ebay api stuff?
[14:50:09] Prutheus: mattwc: today i found a new question ... https://developer.ebay.com/Devzone/finding/CallRef/findItemsAdvanced.html look at categoryId, I can define multiple ones in a call, but how to add multiple categoryId to my params hash?
[14:53:31] Prutheus: hm,,,,so i cant define multiple categories?
[14:57:21] Prutheus: hm okay yeah you are right, then i just dont support multiple categories, what else should i do :/
[14:58:07] Prutheus: i can do a category(0)
[14:58:13] Prutheus: category(1) like the itemfilters
[15:51:09] Prutheus: Quit: Page closed

2018-02-04

[18:52:56] Prutheus: has joined #ruby
[18:53:28] Prutheus: Hello. I have an issue with ruby-ebay and api calls/results. Could someone help me please? Detailed question is here: https://github.com/hakanensari/ebay-ruby/issues/1
[19:01:30] Prutheus: Someone an idea why the itemfilters are not working?
[19:03:06] Prutheus: Am I specifying them wrong or what? Please help me
[19:10:39] Prutheus: mattwc: it works all except the item filters, same behavior with rebay gem, so what am i doing wrong?
[19:12:31] Prutheus: Ok, but do you know a gem which is recent?
[19:12:33] Prutheus: i cant find others
[19:14:33] Prutheus: mattwc: you think ebayr would work?
[19:24:04] Prutheus: mattwc: I even cant login with ebayr, mhhh, what does it want from me?
[19:29:34] Prutheus: mattwc: ebayr is also not working ... what should I try now?
[19:45:32] Prutheus: mattwc: ebayr works, but is not supporting the finding api ...
[19:54:27] Prutheus: mattwc: &REST-PAYLOAD&keywords=Acer&ItemFilter(0).name=MinPrice&ItemFilter(0).value=1000.0
[19:54:52] Prutheus: this should set the output to only include items with minimum 1000usd price as current price, right?
[19:56:09] Prutheus: https://developer.ebay.com/Devzone/finding/CallRef/findItemsAdvanced.html#sampleaspectHist
[19:56:15] Prutheus: according to here, it should be right, yes?
[20:15:09] Prutheus: mattwc: back to rebay gem, which is working fine except with itemfilter, i am not really a ruby pro yet, could you pelase check if itemfilters are supported by that gem?
[20:20:09] Prutheus: what do you mean, i do not understand
[20:29:10] Prutheus: But how do I specify it in the params ?
[20:29:31] Prutheus: find_items_advanced(keywords: 'Acer', itemFilter: [{name:'MinPrice', value:'1000'}])
[20:29:34] Prutheus: thats not right
[20:36:01] Prutheus: Thanks, works!! Wow, you are awesome
[20:36:40] Prutheus: Btw, could you also explain me the difference between 'name':... and name:.... please
[21:11:15] Prutheus: Quit: Page closed

2018-02-03

[10:16:11] Prutheus: Hello. I have a hash like { '@name' => 'Lucas', '__value__' => '' } and rubocop installed. Everytime i save the file robucop changes the hash to { :@name => 'Lucas', :__value__ => '' } but I dont want this. Any idea how to stop rubocop from that?
[10:40:33] Prutheus: yeah, why do you ask?
[10:44:06] Prutheus: what do you mean exactly?
[10:45:00] Prutheus: yes right. but rubocop should not change string to symbol, why is it doing that?
[10:45:34] Prutheus: but rubocop is doing that
[10:45:38] Prutheus: and this is stupid
[10:46:55] Prutheus: what do you say? I do not understand
[10:50:37] Prutheus: yes its my real code.... is there any change to stop rubocop for cheching for a code section?
[11:03:50] Prutheus: Quit: Page closed

2018-02-02

[12:46:27] Prutheus: has joined #ruby
[12:54:32] Prutheus: Hello. I have a hash like { '@name' => 'Lucas', '__value__' => '' } and rubocop installed. Everytime i save the file robucop changes the hash to { :@name => 'Lucas', :__value__ => '' } but I dont want this. Any idea how to stop rubocop from that?
[13:20:48] Prutheus: Hello? Please?
[13:43:22] Prutheus: tbuehlmann: yeah
[13:43:32] Prutheus: tbuehlmann: any idea how to disable it for that code section?
[13:47:02] Prutheus: tbuehlmann: no i have no plan why it does that ... i thought you could help with that :/
[15:19:28] Prutheus: Hello. I have a hash like { '@name' => 'Lucas', '__value__' => '' } and rubocop installed. Everytime i save the file robucop changes the hash to { :@name => 'Lucas', :__value__ => '' } but I dont want this. Any idea how to stop rubocop from that?
[15:40:49] Prutheus: Hello. I have a hash like { '@name' => 'Lucas', '__value__' => '' } and rubocop installed. Everytime i save the file robucop changes the hash to { :@name => 'Lucas', :__value__ => '' } but I dont want this. Any idea how to stop rubocop from that?
[16:10:31] Prutheus: Hello. I have a hash like { '@name' => 'Lucas', '__value__' => '' } and rubocop installed. Everytime i save the file robucop changes the hash to { :@name => 'Lucas', :__value__ => '' } but I dont want this. Any idea how to stop rubocop from that?
[16:26:59] Prutheus: Hello. I have a hash like { '@name' => 'Lucas', '__value__' => '' } and rubocop installed. Everytime i save the file robucop changes the hash to { :@name => 'Lucas', :__value__ => '' } but I dont want this. Any idea how to stop rubocop from that?

2018-01-25

[12:56:13] Prutheus: has joined #ruby
[12:56:38] Prutheus: Hello. I am in a Rails application with a model which has columns: main, subcat
[12:57:21] Prutheus: the data looks like: main, subcat: car, ferrari car, bmw car, porsche food, apple food, banana
[12:58:19] Prutheus: I want to convert a array of these model data into a hash like: {'car'=>['ferrari', 'bmw', 'porsche'], 'food'=>['apple', 'banana']}
[12:58:23] Prutheus: how could I do this?
[14:08:21] Prutheus: hey za1b1tsu thanks for you suggestion but this is not working. the problem is, taht i dont know the main categories yet. here a bpaste of the data: https://bpaste.net/show/cca898ae8a85 I want to get a hash with main as keys and subcats in arrays as values of them.
[15:07:31] Prutheus: tbuehlmann: yeah, great, but how to access the hash now? which variable is it? the variable hash is undefined
[15:33:05] Prutheus: Quit: Page closed

2018-01-14

[15:10:42] Prutheus: has joined #ruby
[15:12:22] Prutheus: Hello. I am on rails. Per default, when I do a redirect to a controller, I can give a notice there which i can show in the erb file as info or so ... now, I wanna give enxt to notice an second text, called error, but I get when I use: "<p id="error_explanation"><%= error %></p>" following error: "undefined local variable or method `error'" called via: "redirect_to scripts_path, error: "'#{@script.name}' already running.""
[15:12:28] Prutheus: But why? how to realize what I wanna do?
[15:27:56] Prutheus: Quit: Page closed

2018-01-12

[05:53:54] Prutheus: has joined #ruby
[05:56:28] Prutheus: Hello. I am on rails. I want to download a file via a send_file call. This worked yesterday. But however, now it does not work anymore. When I click on my URL which calls a function where send_file is inside, no file gets downloaded. But in the server log, the send_file was successful (but with 0.1ms every time, what is too few for such a big file). So what could I do wrong? What part of code do you need to see?
[06:20:15] Prutheus: Quit: Page closed

2018-01-11

[15:26:01] Prutheus: has joined #ruby
[15:26:45] Prutheus: Hello. I am writing a Rails webapp where I want to run several scripts in background (via threads). THe problem is , i need to store the threads in database so I can start and stop them manually. But Marshal cant convert threads, so how could I do that?
[15:27:21] Prutheus: what do you mean?
[15:28:12] Prutheus: No that is not possible. I have a thread which do webscraping
[15:28:24] Prutheus: I wanna launch several webscrapers via the interface
[15:28:34] Prutheus: The webscraper is a thread, not a counter
[15:31:21] Prutheus: nono that is not possible. the webscraper already is done. very complex. I just need to run or stop him via his Class methods start or stop, which are handling a thread of him
[15:33:09] Prutheus: Or is there any way I can perform the thread operation on a variable which is rails-servesided, so I mean my a which is SCRAPER_CLASS.new element, that is server-sided and I can access it from somewhere
[15:33:19] Prutheus: i am new to rails so I dont know where to put it to be global
[15:37:49] Prutheus: can store it globally with $ variables
[15:40:50] Prutheus: Quit: Page closed
[16:03:52] Prutheus: has joined #ruby
[16:03:56] Prutheus: Hey, its me again
[16:04:09] Prutheus: one more question to rails:
[16:05:12] Prutheus: How can I create a method like the Controller defaults new method and route it, but it should take no controller argument. e.g. Recipes Controller should have a download method which route is /recipes/dowload , without a recipe id in route
[16:05:39] Prutheus: now, i always get a error at set_recipe scaffolded function with Couldn't find Recipe with 'id'=download
[16:59:09] Prutheus: Quit: Page closed

2018-01-10

[21:29:55] Prutheus: has joined #ruby
[21:30:46] Prutheus: Hello. I need to parse a difficult string: "Building: ?????? ??????? ???? ??????Address: محيط الظريفRemark: \nمستودع للايجار محيط الظريف مساحة 300متر مع نزلة كميون ايجار شهري 1500$ للاستعلام 03124927 \\ 71127376" Need to parse the parameters Building, Address, Remark etc. Difficulty: String is not always same. Maybe Building is missing, but some Parameters more
[21:31:02] Prutheus: And the parameters are directly without space behind one other, so how to split?
[21:36:36] Prutheus: its from taht site
[21:36:37] Prutheus: http://www.properties.com.lb/Property-Details/97683
[21:37:32] Prutheus: cjohnson: so any better idea maybe? becasue that is very difficult
[21:41:32] Prutheus: I use currently nokogiri
[21:41:43] Prutheus: but that html ... is still just a p block
[21:42:34] Prutheus: you think so, but now take that one
[21:42:41] Prutheus: http://www.properties.com.lb/Property-Details/97704
[21:42:47] Prutheus: the remark is f*cked up
[21:43:48] Prutheus: the b's are the seperators
[21:44:08] Prutheus: ill try to code that behavior
[23:08:05] Prutheus: Quit: Page closed

2018-01-07

[10:57:20] Prutheus: has joined #ruby
[10:58:06] Prutheus: Hey. I recently read about an interesting topic. There, it was able to convert ruby variables to strings (or streams) and backwards. So I could store variables in config files and recreate them .... but I cant find it anymore, anyone an idea what that was?
[11:10:53] Prutheus: yes it was marshal, thanks a lot!
[11:19:52] Prutheus: Quit: Page closed
[11:24:44] Prutheus: has joined #ruby
[11:25:11] Prutheus: Hey it is me again.
[11:25:34] Prutheus: Is it also possible to dump data with Marshal which is a GTK Element? because I just get ``dump': no _dump_data is defined for class Gtk::Viewport`
[11:26:11] Prutheus: What I want to do: I wanna store the values i have entered in some gtk elements... but i need to sotre it individually and cant jsut store my whole gtk container, can i?
[12:07:01] Prutheus: Quit: Page closed

2018-01-03

[15:02:30] Prutheus: tbuehlmann: not possible with rubocop
[15:02:58] Prutheus: canton7: thanks!
[15:08:03] Prutheus: Quit: Page closed
[15:25:40] Prutheus: has joined #ruby
[15:25:52] Prutheus: Hi. I have following code: https://bpaste.net/show/d1cbdf553751
[15:26:24] Prutheus: I want to merge all csv files and apply a header to my new file. But for some reasons, the header sting is inserted 2 times, at the beginning of my new file and in the middle somewhere
[15:30:10] Prutheus: Client Quit