Category "ruby"

$(document).ready does not work in Rails

I'm using a *.js.erb in my Rails-App, which reacts to a clicked Link. But when I render my page, by getting there via a link_to, I have to refresh the Page, to

Convert Ticks to @timestamp in logstash with Ruby-plugin

I query every minute against a MSSQL Database with jdbc-plugin. In this Database my timestamp is stored in ticks. Field-name is lastupdate. Now I wanted to conv

Failed to build gem native extension (installing Compass)

When I attempt to install the latest version of compass (https://rubygems.org/gems/compass/versions/1.0.0.alpha.17), I get the following error. ERROR: Error i

full width responsive image with image tag in Rails 4 app

Im using the code below to make header images appear randomly in a app I´m making. I want the images to span the whole width of the screen but somehow it

Programming Unity Games with Ruby

So I see that unity has the support for c#, JS and Boo. I could learn one of these but I would like to make a 'compiler' or something similar that would let me

Query method issue on rails upgrade to 6.1.5

enter image description here Upgraded rails from 6.0.3 to 6.1.5 but having issues with query methods like eager_load and references. class Note < Application

SSL verification error when installing cocoapods

What I did sudo gem install cocoapods This is the full message from terminal ERROR: You must add /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2 to your

Capybara and Factorybot - created data does not appear

I am facing a wired issue, factoryBot is creating a record in Db, but when capybara try to access it, there is no record in HTML. I tried debugging with "byebu

Difference between after_create, after_save and after_commit in rails callbacks

The difference between after_create, after_save and after_commit in Rails is that: after_save is invoked when an object is created and updated after_commit is

Iterating over array without returning the array

I'm working on a module to format print output for the console. The problem I'm running into is when I call .each on an array that I have, it returns the array

Sinatra NoMethodError at / undefined method `stylesheet_link_tag' for #

I am currently making an app with sinatra and i've been working for hours to try to implement bootstrap in it, and realizing how much easier it is in rails. An

Incrementing letters using .next

def home letter = 'A' @markers = Location.all.to_gmaps4rails do |loc, marker| marker.infowindow render_to_string(partial: '/locations/info',

rbenv installation permission denied

Hi all I'm trying to set up a dev environment and I've been following a tutorial via; Link to tutorial I'm not doing very well and have no real experience of t

How to display Datatable tabletools (copy, csv, excel, pdf, save) in ruby on rails

I am using Datatable in my ruby on rails application. I follow the same one which is here.. https://github.com/rweng/jquery-datatables-rails And My datatable

WEBrick run on hanami 1.0.0 shows errors because of wrong inflection

I generated model with hanami generate model stimulus. Then I fixed "stimuluses" to "stimuli" in the migration file name and inside, the table name. Everytime

Ruby ODBC with remote database

I am working on an application that connects to a legacy database, Eloquence, through ODBC and SQL/R. I set up my server with UnixODBC and setup the drivers and

gem eventmachine fatal error: 'openssl/ssl.h' file not found

Just installed El Capitan and can't install gem eventmachine 1.0.7. openssl is at 1.0.2a-1. Tried to use --with-ssl-dir but it seems ignored. Reported it to th

Error building gems in Mountain Lion

I just bought a new MacBook Pro (obviously w/ML). First thing I'm doing is installing development tools. I installed Ruby with rvm and I've also got Homebrew in

Rails action Mailer raise_delivery_errors, how does it works? How to detect bounces?

I have a Rails 4.2.0 application which sends lots of mails, it's a elearning platfrom. At the moment I have problems with bounces, Lots of the Mails coming bac

Errno::EACCESS: Permission denied @ dir_s_mkdir

I am pretty new to Ruby.. was following the instructions on TeamTreehouse installing Ruby Development Environment on OSX (Yosemite). When I got to the step to