Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Problems on migrating from Ruby 1.8 to 1.9
Search
elitau
May 16, 2012
Programming
530
1
Share
Problems on migrating from Ruby 1.8 to 1.9
Problems encountered on migration simfy codebase from ruby 1.8 to 1.9
Talk for @colognerb
elitau
May 16, 2012
More Decks by elitau
See All by elitau
Feature Toggles
elitau
0
490
Testbarkeit (in Ruby)
elitau
0
71
Testing Best Practices
elitau
2
490
Other Decks in Programming
See All in Programming
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
0
120
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.5k
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
110
dRuby over BLE
makicamel
1
270
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
3
230
net-httpのHTTP/2対応について
naruse
0
420
AIエージェントの隔離技術の徹底比較
kawayu
0
450
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
150
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
770
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
11k
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
19
7.8k
New "Type" system on PicoRuby
pocke
1
410
Featured
See All Featured
Claude Code のすすめ
schroneko
67
220k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Context Engineering - Making Every Token Count
addyosmani
9
930
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
120
エンジニアに許された特別な時間の終わり
watany
107
240k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
220
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Transcript
PROBLEMS ON MIGRATING FROM RUBY 1.8 TO 1.9 SEIT 2012
@hurx github.com/elitau
ENCODING • Each and every String needs an Encoding •
# encoding: UTF-8 • http://stackoverflow.com/questions/3291017/how-can-i-avoid- putting-the-magic-encoding-comment-on-top-of-every-utf-8- file-in • https://github.com/m-ryan/magic_encoding • http://blog.grayproductions.net/articles/ ruby_19s_three_default_encodings
LOAD PATHS • Ruby 1.9 removed “.” from load paths
• It was deemed a "security" risk • File.expand_path(__FILE__) • require_relative • require './filename' • http://stackoverflow.com/questions/2900370/why-does- ruby-1-9-2-remove-from-load-path-and-whats-the-alternative
MD5 • md5 module is gone • instead of MD5
it is now Digest::MD5
DEBUGGER • https://github.com/cldwalker/debugger • works with 1.9.2 and 1.9.3
YAML PARSING • Psych (the new ruby YAML parser) is
stricter with syntax • Fix your YAMLs • Dirty fix: in config/boot.rb require 'yaml' YAML::ENGINE.yamler = 'syck' • http://stackoverflow.com/questions/4980877/rails-error- couldnt-parse-yaml
PARSEDATE • Ruby 1.8 has a Parsedate module, gone in
1.9 • use Date.parse instead • http://stackoverflow.com/questions/4724417/ruby-where-has- parsedate-gone-in-1-9
CASE SYNTAX • Colons do not work in 1.9 anymore
• when ‘foo’ : ‘bar’ • when :foo then :bar
ARRAY.TO_S • ree-1.8.7-2011.03> [1,2,3].to_s => "123" • 1.9.3p125> [1,2,3].to_s =>
"[1, 2, 3]" • Do not use implicit conversions • Better: [1,2,3].join(‘’)
MORE RESOURCES • http://www.rubyinside.com/19walkthrough/ 19$, 3 hours, Screencast • http://www.google.com/search?q=ruby+1.8+1.9+difference