Skip to content

Instantly share code, notes, and snippets.

View larskanis's full-sized avatar

Lars Kanis larskanis

  • Comcard
  • Europe/Germany
View GitHub Profile
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem "pg", "~> 1.1"
gem 'activesupport', path: '../activesupport'
gem 'activerecord', path: '../activerecord'
gem 'activemodel', path: '../activemodel'
# frozen_string_literal: true
# tiny rerunner (I use this on local to rerun script)
# require_relative '../rerunner/rerunner.rb'
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'pg', path: '../ruby-pg.git'
gem 'activesupport', path: '../rails/activesupport'
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'pg'
gem 'activerecord', '5.2.0'
gem 'memory_profiler'
gem 'benchmark-ips'
end
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'pg', "1.0.0"
gem 'activerecord', '5.2.0'
gem 'sequel', '5.8.0'
# gem 'sequel_pg', :require=>'sequel'
gem 'memory_profiler'
gem 'benchmark-ips'
@larskanis
larskanis / 0001-Fix-Ruby-2.4-MINGW-build.patch
Created January 12, 2018 09:09
Fix ruby-odbc on Ruby-2.4 and MINGW
From 53fe2f8c992c28d57b19733723ce43f260376eac Mon Sep 17 00:00:00 2001
From: Lars Kanis <[email protected]>
Date: Wed, 6 Dec 2017 08:53:24 +0100
Subject: [PATCH] Fix Ruby-2.4 MINGW build
Since the following commit to Ruby-2.4, have_library() with an empty function
is no longer treated as "main()". Therefore
"gem install ruby-odbc -v 0.99998" fails on RubyInstaller-2.4 currently.
https://github.com/ruby/ruby/commit/6ff3a8e3bb6c6cf25c134300ebf9877907d739c1
ExecJS::ProgramError in Cats#index
Showing c:/Users/kanis/railstest2/app/views/layouts/application.html.erb where line #7 raised:
TypeError: Das Objekt unterstützt diese Eigenschaft oder Methode nicht.
Extracted source (around line #7):
4: <title>Railstest2</title>
5: <%= csrf_meta_tags %>
@larskanis
larskanis / print_enc.rb
Last active January 14, 2020 10:54
Print various encoding settings of ruby
# encoding: cp852
# Run:
# ruby print_enc.rb abc äöüЖあ𝄞
# in rubyinstaller2/packages/rubyinstaller/recipes/compile/ruby-2.4.1/src/build-x86_64-w64-mingw32
# $ make ruby.exe
# $ ruby --disable=gems -I .ext/x64-mingw32 print_enc.rb a
@larskanis
larskanis / Gemfile
Created January 21, 2017 21:48
Gemfile of a fresh rails-5.0.1 app.
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.1'
@larskanis
larskanis / Gemfile
Created January 20, 2017 04:33
Gemfile of a fresh Rails-5.0.1 project
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.1'
@larskanis
larskanis / pg.rb
Last active January 19, 2017 19:43
#!/usr/bin/env ruby
begin
require 'pg_ext'
rescue LoadError
# If it's a Windows binary gem, try the <major>.<minor> subdirectory
if RUBY_PLATFORM =~/(mswin|mingw)/i
major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or
raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}"