Rubymine doesn't recognise .jb file types in New View File dialog
In rubymine, when working on a rails project, if i got the a controller action, in the left margin there is a file icon, when i click it it opens either the associated view for that action, or a dialog...
View ArticleWhat does script[/[^\d]+/, 0] do in Ruby?
Specifically: script = script[/[^\d]+/, 0] if scriptMy guess is it's some sort of substring function, but it's hard to find documentation on the Googles about it.
View Articlepins controller uploading duplicates of image rails
I'm stuck uploading 2 copies of each imagei guess im gong to add a way to remove sepearte images but for now how do i stop duplicates?some help getting through the double vision would help. im almost...
View ArticleWhat is the state of Ruby as a compiled language?
Ruby has been around for a while now so I was wondering if there was any work being done on a compiler for it? I know that compiler design is hindered by things like Eval() so I would not expect...
View ArticleWhy do some Ruby methods need a bang and others don't to be a destructive...
For example, array.pop doesn't need a bang to permanently alter the array. Why is this so and what was the reasoning behind developing these certain Ruby methods without this conformity?
View ArticleHow to find record depending upon the updated_at in rails
I have to find the record depending upon their updated_at column. For this I am comparing updated_at with todays date. I tired in following ways but it wont workedtodays_date =...
View ArticleSSL certificate verify failed error when trying to install gems
Im on OSX 10.10.5 and using RVM and ruby version 2.3.1. When i run gem install <gem_name> i get the following errorUnable to download data from https://rubygems.org/ - SSL_connect returned=1...
View ArticleStruggling to install ruby and rails because of OpenSSL?
Just for some context of my system:Apple m4 chipJust switched from an older intel laptop to a m4 chip in case that makes any difference.Using rvm to install rubySteps I took:`rvm install 3.3.6...
View ArticleWhat's the purpose of "[0]" appended to a match method in ruby?
I was going through the Exception Handling chapter of the Bastards Book of Ruby and I came across a bit of code in between the lines of:while 1 puts "Enter a number>>" num =...
View ArticleRails attachment delegation to another model optionally
I have two models InInvoice, Disbursement. Both are associated: InInvoice optionally belongs_to disbursement. Both have a has_one attachment called att.InInvoice is supposed to delegate att calls to...
View ArticleConvert camelCase to dash-case (hypens) in pure ruby
There are plenty of posts about the opposite way. But how to I convert camelCase to camel-case in ruby? My regex-game is pretty low ... here is it the other way around:def underscore(string)...
View Articleruby-inotify unexpected tilde ~ added to some reported file names
I have a ruby script that runs waiting for a scanned pdf document to be uploaded to a path and then does some additional processing and notifications. The scanner is a Canon ImageRunner scanner using...
View ArticleI am yielding to an ERB file, but it is rendering in plain text and not HTML....
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,...
View ArticleWhat does
I have code: def make_all_thumbs(source) sizes = ['1000','1100','1200','800','600'] threads = [] sizes.each do |s| threads << Thread.new(s) { create_thumbnail(source+'.png', source+'-'+s+'.png',...
View Articlelooking for recommended upgrade path for app (ruby 2.3.8 , rails 4.2.11) to...
as the title states, I'm looking for a recommended path for app (ruby 2.3.8 , rails 4.2.11) to the latest stable versions of ruby and rails, that is the safest, most stable option for a very, very...
View ArticleRead and write YAML files without destroying anchors and aliases
This question has been asked before: Read and write YAML files without destroying anchors and aliases?I was wondering how to solve that problem with many anchors and aliases?thanks
View ArticleMissing C-allocation functions inspite of include stdlib.h in old C++ - Ruby...
I am trying to get this PersonalRapidTransit simulation to run. It was written by John Lees-Miller 13 years ago, so assume that it uses C++11 or older. Unfortunately the Github repository is closed so...
View ArticleDeprecation Warning: "Bolding log text with a positional boolean is...
When running my tests in a Rails application, I see the following deprecation warning multiple times:DEPRECATION WARNING: Bolding log text with a positional boolean is deprecated and will be removed in...
View ArticleUnable to install debase gem
I am trying to debug code in Rubymine. It looks like we need to install debase first. I tried to search in google but could not find any solution.$ ruby -vruby 3.0.0p0 (2020-12-25 revision 95aff21468)...
View ArticlePosting with headers
I have simple post using net/http.uri = URI("https://example.com")params = {title: 'foo', body: 'bar'}Net::HTTP.post_form(uri, params)Now, I need to add a header, but I can't find a way to make it...
View Article