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

Ruby version collisions

Heroku no longer accepts the Ruby version that our app is using. So we intended to just use the latest Ruby version and rebuild until we hit this:Make sure that `gem install msgpack -v '0.5.11'`...

View Article


Rails Byebug Did Not Stop Application

I want to use byebug to debug my application but the app is never stop although I already put byebug inside my code. Here is my Gemfile.group :development, :test do # Call 'byebug' anywhere in the code...

View Article


How to make ERB or ERUBI escape HTML in the template without escaping the...

I'm using ERB or ERUB or Tilt here outside of Rails and I want to make my HTML templates work like rails where stuff is HTML escaped by default.e.g.<!-- file.html.erb --><h1>Hello <%=...

View Article

How to add Infrastructure Agent to Heroku applications

I am attempting to have the New Relic Infrastructure Agent monitor my heroku applications.The documentation says to run the following:docker run \-d \--name newrelic-infra \--network=host...

View Article

Linkedin Oauth In Ruby on Rails is Not Logging In Every Few Times

I have been developing an app that is using new Linkedin OpenID login feature. The thing is that it works, but it works most of the time. Every few times, (3-10, quite random) it doesn't log you in but...

View Article


Rails Many-to-Many Association: Unique Email Per Organization Is Being...

Here I have created many to many association between users and organizations through memberships and It is working fine but What I want is I want the same user(i.e user with same email) to be inserted...

View Article

What's the nature of "property" in a Ruby class?

I don't understand the keywords like attr_reader or property in the following example: class Voiture attr_reader :name attr_writer :name property :id, Serial property :name, String property...

View Article

Ruby on Rails #find_each and #each. is this bad practice?

I know that find_each has been designed to consume smaller memory than each.I found some code that other people wrote long ago. and I think that it's wrong.Think about this codes. users =...

View Article


Ruby Rspec Mock Same instance to behave different in the first and second call

I have a code that looks like this:def call(some_id:) verify_before = @verify.call(some_id) return verify_before if verify_before.sucess? did_something = @processor.call(some_id) return did_something...

View Article


Ruby db migration fail

Hello im trying to migrate a database with this command:rake db:migratebut i have a error and i dont understand itoskar@debianOskar:~/Documents/fdb-server-migration$ rake db:migraterake...

View Article

How to print directly to HAML buffer?

I'm trying this (haml 6.3.0):def my_helper Haml::Helpers.html_concat('Hello, world!')endThen, in my.haml I do this:- my_helperHowever, I'm getting:NoMethodError: undefined method `html_concat' for...

View Article

React-Native init - Cocoapods was resolved

if i run "npx react-native init testApp" i get the following error. What should i do to resolve this error?An error occurred while installing nkf (0.2.0), and Bundler cannot continue.In Gemfile:...

View Article

How to create a HAML6 helper that renders and returns at the same time?

I'm trying to design a helper for HAML, which would work like this:%table- tabular(items) do |i| %tr %td = i[:title]I expect it to render the following...

View Article


Changing from JS Bundling to ImportMap in Rails 7.2

I have a problem when changing from JS Bundling to ImportMap in Rails 7.2 . I deleted the gem jsbundling-rails and add importmap-rails in my Gemfile, then run rails importmap:installAfter that, I ran...

View Article

Image may be NSFW.
Clik here to view.

Unexpected Error Diagnostics for erb files

My current neovim (lazyvim) show weird errors for my .erb files.How can I find out which linter is showing them to me in order to configure it correctly?My linter for ruby areerb-lint for erbrubocopMy...

View Article


Elixir-like pipes in Ruby to process collections

In Elixir there is a great pipeline operator working like this:"hello, world!" |> String.split(" ") |> Enum.map(&String.capitalize/1) |> Enum.joinIn Ruby we can use similar syntax:"hello,...

View Article

Can't use binding.break in docker-compose

I am running a Rails 7 app through docker-compose. When I try to use binding.break in the code, my attached terminal shows something like the following:web | Started POST "/media_uploads" for...

View Article


Why "require 'rational'" causes "cannot load such file -- rational" error in...

I've used a gem: mini_exiftool-2.11.0 in my rails app with bundler. And it manually require 'rational' in a file. Maybe it is for early ruby version when rational needed to be required for use. Now we...

View Article

Generate a nested JSON array in JBuilder

I have this models in ruby on railsBranch model: has_many :menusclass Branch < ActiveRecord::Base belongs_to :place belongs_to :city has_many :menus , dependent: :destroy belongs_to...

View Article

Redmine is down after attempt to setup smtp configuration

Today I set up a Redmine instance on Ubuntu Server 20.04 for the first time. That worked out quite well so far. So afterwards I set up a Mattermost instance and installed the Redmine Messenger plugin...

View Article
Browsing all 4612 articles
Browse latest View live


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