No such file or directory - git config init.defaultbranch (Errno::ENOENT)
I installed Ruby on rails on cmd, but it had error as No such file or directory - git config init.defaultbranch (Errno::ENOENT). I can't solve this problem.I tried installing on the web guide but it...
View ArticleWhen do you need to prefix Ruby constants with "::"? (uninitialized constant...
The error is something like NameError: uninitialized constant Foo::Bar (when Bar is not a descendant of Foo).I get that it has something to do with loading (autoloading?) constants, and I feel that...
View ArticleWhat does send() do in Ruby?
Can someone please tell me what the following snippetobj.send("#{method_name}")is and does?
View ArticleUndefine variable in Ruby
Let's say I'm using irb, and type a = 5. How do I remove the definition of a so that typing a returns a NameError?Some context: later I want to do this:context = Proc.new{}.bindingcontext.eval 'a =...
View ArticleAn error occurred while installing mysql2 (0.5.4), and Bundler cannot...
I'm trying to create a project with mysql as a database, ran commandrails new project_name -d mysqlgot the following errorsCould not find gem 'mysql2 (~> 0.5)' in locally installed gems. rails...
View ArticleIs there a way to turn of friendly_id or at least the history module during...
I have a Rails application where I added the friendly_id with the history module enabled and performance during tests plummeted. I'm talking about going from 15 minutes to 30 minutes in the absolutely...
View Articleruby on rails add a column after a specific column name
I tried to add a column to a table after a specific column in the table.Here is what I did:rails generate migration add_reaction_id_to_patient_allergies reaction_id: integer :after =>...
View ArticleDifficulty Installing Ruby 3.0.0 via RVM on macOS [closed]
ruby-3.0.0 - #compiling....................................................................................................-Error running '__rvm_make -j16',please read...
View ArticleRuby Eval explaning the evaluated result
I have an app where XL like formulas are stored in the DB, and we use eval to get the results from the formula. e.x formula = "a + b - c", and we do eval(formula), and this works.Now we want to be able...
View ArticleCarrierWave / MiniMagick not updating file extension after convert
I'm using MiniMagick with CarrierWave to process some images on a Rails 5.2 app. My goal is to convert the original image to jpg, and create two other versions (resized).My issue is that while the...
View ArticleRspec not able to trigger method inside after_commit callback
I am working on writing a test case for a model Benefit. The class file contains an after_commit callback which calls a method update_contract. It also has belongs_to :contract, touch: true.@contract...
View ArticleHow to tell gem command not to use SSL
I am trying to run the gem command to install/update some gems, but due to some network restrictions in this area, I get this error:ERROR: While executing gem ... (OpenSSL::SSL::SSLError) SSL_connect...
View ArticleROR + Unable to install tiny_tds
Here I am trying to fetch data from MS-SQL Server 2008 to my Rails application on Ubuntu 10. But I am unable to install tiny_tds. I follow the step given at github. But no response. Please guide me to...
View ArticleRuby Constructors and Exceptions
New to Ruby, and I'm trying to figure out what idiom to use to restrict some integer values to the constructor of a class.From what I've done so far, if I raise an exception in initialize(), the object...
View ArticleRuby `resolve-replace` gives net open timeout with ruby 2.6 or below
This issue starts appearing after adding resolv-replace in the environment.Please see the backtrace, failure is in original_resolv_initialize call in constructor.2024-05-21 17:54:35 - Net::OpenTimeout...
View ArticleIs there a command to add gem to gemspec?
I know there is a command to add a gem to Gemfile: bundle add GEMNAME, but is there a similar command to add a dependency to gemspec?Is there something like bundle add rails --gemspec?Is there a...
View ArticleNet::OpenTimeout (Seahorse::Client::NetworkingError) using aws-sdk-ec2
I have an EC2 instance in which I am running two scripts one ruby and another python to create another EC2 instance using aws-sdk for respective languages. Boto3 for python and aws-sdk-ec2 for ruby in...
View ArticleHow to use a Puppet File Resource to give different permissions on a...
I would like to use Puppet to manage a directory. I want the directory to be owned by user root and group admin, with 0770 permissions.I would like all files in the directory to be owned by user apache...
View ArticleAdding Activeadmin to existing rails 6 Api with devise already installed
Hey I have a rails api app with devise and jwt installed already and working perfectly fine.I installed activeadmin to handle data management but when i try to navigate to /admin i get a message on the...
View ArticleDifficulty upgrading Ruby version via Homebrew
I am struggling to update my Ruby version via Homebrew. I don't quite understand what's going on. It says Ruby 3.3.1 is 'arealdy installed' but then when I look at the version it says 2.6.10. How do I...
View Article