Binding Parameters with Rails ActiveRecord::Base.connection.exec_query in mysql
I am attempting to utilize binding parameters in Rails using ActiveRecord::Base.connection.exec_query for a mysql database, but I'm doing something wrong.Here is the code:query = "Select * from...
View ArticleRuby on Rails: rails s or rails sever not working on mac
Here is my processWhat I tried:uninstalling & re-installing rails and railtiesupdates rails from 4.2.5 > 4.2.8bundle installAs for the BigDecimal below, I have uninstalled it and re-installed...
View ArticleHow to pass the current request id to ActiveJob and ActionMailer for tagged...
I want to improve the logging of my application. I use tagged logging with the request_id. Basically this is rails standard for production environments.I'd like to know from where log lines from...
View ArticleRails 6 - Nokogiri LoadError conflict between development and production...
When I try deploy using capistrano gem I get:rake stderr: rake aborted!LoadError: cannot load such file -- nokogiri/nokogiriIn my Gemfile.lock I can see that nokogiri is installed nokogiri...
View ArticleGetting undefined method `get' for #
Rails 4.2.5, rspec-rails 3.0.2I want to test my API. So I created requests directory inside /spec. There is a file called projects_spec.rbHere is the code:describe 'Projects API' do describe 'GET...
View ArticleHow to install fluentD plugins with docker-compose / dockerfile combination...
I am trying to install a docker plugin to fluentD in my local docker setup.My problem is that the plugin installs perfectly but then fluentD will complain on startup:Step x/x : RUN gem install...
View ArticleNo such file or directory @ rb_sysopen Error with AWS S3
I am trying to open a CSV File stored in an AWS S3 using Rails Active Storage but am getting the below error message. I am able to upload and download files without issues but seems to be an issue with...
View ArticleHow do I check if there's a nil set or not in an array?
If I set some nil values to an array, I don't seem to be able to check for them. I have tried any? and empty?. array = [nil, nil, nil]#=> [nil, nil, nil]array[1].any?#=> "NoMethodError: undefined...
View ArticleHow can I debug Fastlane file in VSCode with "VSCode rdbg Ruby Debugger" or...
I'm trying to debug my custom lane Fastlane code within VSCode, but it cannot find Fastlane source code. What may be a minimal launch.json snippet and what other setup is necessary?So far I tried the...
View ArticleTrouble with pod install of hermes engine on m1 mac
I've created a React-Native application as of 0.70.6, went through the grief of cocoapods and everything that comes with development on Apple's silicon chips (M2) and got it working and have done quite...
View ArticleHow to pass arguments to controller from routes in rails?
I have a controller action as followsdef method params //work with paramsendand I want to pass arguments to the controller from routes.rbget '/link' , to: 'controller#method'and I don't want parameters...
View ArticleWhat happens to jobs that are executing when a delayed_job process is killed?...
Say you have a server that gets decommissioned while a job is running. The job never finishes but it stays locked. Will it be stuck forever? Is there any way to rectify this?
View ArticleRails error: can't activate redis (>= 3, < 5), already activated redis-5.0.4
I tried to deploy my Rails app, and got the errorcan't activate redis (>= 3, < 5), already activated redis-5.0.4. Make sure all dependencies are added to Gemfile. (Gem::LoadError)I've tried...
View ArticleHow to save image with Paperclip for specific model record
I have a model where each record has an image with a :background field that is used on the frontend. Paperclip is already used in the project, and in the admin panel, I can upload this image, so that...
View ArticleError with ruby version on termux when I try to install metasploit
I was installing metasploit with termux and it said:termux output~ $ ls <br>metasploit-framework storage wiki-termux<br>~ $ cd metasploit-framework<br>~/metasploit-framework $ ruby...
View ArticleNo versions of nokogiri compatible with my Ruby
I am installing a 2017 Rails project from GitHub. It is my understanding I need to first install Ruby and Rails before cloning the project. The project uses Ruby 2.4.1 and Rails version 5.0.1, so I am...
View ArticleRSpec is Freezing
I have rspec configured installed in my rails app. It was working fine (We are just experimenting with rspec so there's only 2 tests). They were working fine. Now rspec is freezing when it's going to...
View ArticleHow to use TLS 1.2 in Ruby Http client
I'm trying to access third party api using TLS 1.2, but getting SSL error event with valid certificatesRuby Version: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]Rails Version:Rails...
View ArticleVSCode Ruby Error Invalid argument @ realpath_rec
This is a reopening of half of problem documented inProblems debugging Ruby in VSCode - debugger not executing AND can not display variablesI went back to the original directory where the problem...
View ArticleRuby Floating Point Math - Issue with Precision in Sum Calc
I'm having some issues with floating point math, and have gotten totally lost in ".to_f"'s, "*100"'s and ".0"'s!I was hoping someone could help me with my specific problem, and also explain exactly why...
View Article