Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Browsing all 4619 articles
Browse latest View live

Trying to understand ruby code for calling a method

I am trying to understand how this piece of ruby works. (Please forgive me if it's been asked before but I could not find anything here or on ruby-lang.org documents.)The code is:some_method do # lines...

View Article


What's the difference between passing an argument and passing a block in Ruby?

I am trying to understand how this piece of ruby works. (Please forgive me if it's been asked before but I could not find anything here or on ruby-lang.org documents.)The code is:some_method do # lines...

View Article


How to automatically set an IRB configuration across all environments for a...

I'd like to set an IRB configuration across an app (all environments, including production) so I don't have to run it every time I use the rails console. The specific configuration isn't that...

View Article

Converting Shopify Liquid theme to PHP: What's the best approach?

Converting Shopify Liquid theme to PHP: What's the best approach?I'm using:kalimatas/php-liquid for Liquid templatingnikic/fast-route for routingCustom implementations for sections and...

View Article

Rails PostgreSQL numeric field overflow ERROR

I have a decimal field for price on my schema and every time that i try to insert the price the pg comes with this ERROR. anybody could give me any light? thank'sconfigurationt.decimal "price",...

View Article


Is it possible to place the .irbrc file in the project folder?

I would like to place the .irbrc file in my project folder to configure the irb console just for that specific project. I am aware that i can configure .irbrc placing it in the home folder but i would...

View Article

How to fix error downloading CocoaPods from my Unity project?

I am programming a mobile game using unity, when trying to build and run I get"Error building Player: iOS framework addition failed due to a CocoaPods installation failure. This will will likely result...

View Article

Dotenv variable not loading

I am trying to access my DOTENV variable in my API request but it is returning nothing.I have added it to my gem file.I have added MOVIE_API = <secret-key> to a file .dotenv in my root. Below is...

View Article


Tying to read a URL with Ruby and open-uri is giving a 403 error

I have a process that has been running successfully on a Raspberry Pi for years that is now suddently failing. I am scraping a website so I am passing a URL to open-uri and then parsing it with...

View Article


Bundle install stuck on devise_saml_authenticatable

Im trying to run bundle install --verbose on an existing ruby on rails project.But the bundle is hanging on this section1: devise_saml_authenticatable (1.9.1) from...

View Article

docker container reloading on any code change or page reload

I've been using docker for a ruby on rails application for the last couple of years with work.Vite has recently been added to the application, and a new vite container added to docker-compose.yml...

View Article

Ruby aws-sdk gem - how to list knowledge base sources?

I have several AWS Bedrock knowledge models. I know their IDs.Looking to a way to read/work with KB sources - for example - run sync process.Trying to use gem 'aws-sdk-bedrock' but it looks like it has...

View Article

Using environment variables in a file path

I want to use an input path in the following code:File.exists?(File.expand_path(path))Can I use environment variables in path, and what should the syntax be?

View Article


gem install psych fails on Ruby 3.3.4

I need to have 2 versions of ruby installed for separate projects (2.6.6p146 and 3.3.4).When I change ruby by using export PATH="...:/c/Ruby33-x64/bin:...", ruby -v reports 3.3.4.However, gem install...

View Article

How can I update Ruby version 2.0.0 to the latest version in Mac OS X v10.10...

I need to update my Ruby version from 2.0.0 to the latest version. I can not use some gems because my version is not updated.I had used Homebrew to install Ruby some time ago. How can I update my Ruby...

View Article


NoMethodError Occurred, undefined method for nil:NilClass

First of all, I know it has been posted, I've seen most of the question posts but I still don't understand how it works.So I'm getting the error:Script 'Terrain Tag Detection ~' line 115: NoMethodError...

View Article

How to fix Homebrew install failing with "Error: Failed to install Homebrew...

Here's some info:I do not have admin privileges to my machine.I'm running macOS Catalina 10.15.5.I use zshell.I have Xcode command-line tools 11.5 but NOT XCode itself.I'm running Ruby v2.6.3p62...

View Article


Bootstrap not working with Rails 8 Beta 1 (Propshaft::MissingAssetError)

Fresh install of Rails 8.0.0.beta1 and Ruby 3.5.5. New Rails app runs no problem using rails new new_app, but using rails new new_app --css bootstrap the following error appears on every page load...

View Article

Compile C++ online in a Rails Application

I am looking for a compiler to compile C++ source code in a rails application. My idea is to get the source code as input, compile it and give the output back to the browser. Of course it should be...

View Article

Tests not run automatically

I'm trying to setup Guard in my Exercism folder, so that all tests are automatically run (using guard-minitest).The folder structure looks like this:.├── exercism└── ruby  ├── bob  │  ├── bob.rb  │...

View Article
Browsing all 4619 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>