-
Notifications
You must be signed in to change notification settings - Fork 0
/
ibruby_about_ruby_gems_etc.html
569 lines (372 loc) · 19.5 KB
/
ibruby_about_ruby_gems_etc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Ruby is a programming language you must have on your computer in order to run ib-ruby. Ruby has various gems (or plugins) that provide various functionality....">
<meta name="keywords" content="getting_startedtroubleshooting, ">
<title>About Ruby, Gems, Bundler, and other prerequisites | ib-ruby documentation</title>
<link rel="stylesheet" href="css/syntax.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">-->
<link rel="stylesheet" href="css/modern-business.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="css/customstyles.css">
<link rel="stylesheet" href="css/boxshadowproperties.css">
<!-- most color styles are extracted out to here -->
<link rel="stylesheet" href="css/theme-blue.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="js/jquery.navgoco.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Anchor.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.0/anchor.min.js"></script>
<script src="js/toc.js"></script>
<script src="js/customscripts.js"></script>
<link rel="shortcut icon" href="images/favicon.ico">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="alternate" type="application/rss+xml" title="documentation-theme-jekyll" href="/feed.xml">
<script>
$(document).ready(function() {
// Initialize navgoco with default options
$("#mysidebar").navgoco({
caretHtml: '',
accordion: true,
openClass: 'active', // open
save: false, // leave false or nav highlighting doesn't work right
cookie: {
name: 'navgoco',
expires: false,
path: '/'
},
slide: {
duration: 400,
easing: 'swing'
}
});
$("#collapseAll").click(function(e) {
e.preventDefault();
$("#mysidebar").navgoco('toggle', false);
});
$("#expandAll").click(function(e) {
e.preventDefault();
$("#mysidebar").navgoco('toggle', true);
});
});
</script>
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
<script>
$(document).ready(function() {
$("#tg-sb-link").click(function() {
$("#tg-sb-sidebar").toggle();
$("#tg-sb-content").toggleClass('col-md-9');
$("#tg-sb-content").toggleClass('col-md-12');
$("#tg-sb-icon").toggleClass('fa-toggle-on');
$("#tg-sb-icon").toggleClass('fa-toggle-off');
});
});
</script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container topnavlinks">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="fa fa-home fa-lg navbar-brand" href="index.html"> <span class="projectTitle"> ib-ruby Doc</span></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<!-- toggle sidebar button -->
<li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li>
<!-- entries without drop-downs appear here -->
<li><a href="https://github.com/ib-ruby" target="_blank" rel="noopener">GitHub</a></li>
<li><a href="news">News</a></li>
<!-- entries with drop-downs appear here -->
<!-- conditional logic to control which topnav appears for the audience defined in the configuration file.-->
<!--comment out this block if you want to hide search-->
<li>
<!--start search-->
<div id="search-demo-container">
<input type="text" id="search-input" placeholder="search...">
<ul id="results-container"></ul>
</div>
<script src="js/jekyll-search.js" type="text/javascript"></script>
<script type="text/javascript">
SimpleJekyllSearch.init({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
dataSource: 'search.json',
searchResultTemplate: '<li><a href="{url}" title="About Ruby, Gems, Bundler, and other prerequisites">{title}</a></li>',
noResultsText: 'No results found.',
limit: 10,
fuzzy: true,
})
</script>
<!--end search-->
</li>
</ul>
</div>
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div id="main">
<!-- Content Row -->
<div class="row">
<!-- Sidebar Column -->
<div class="col-md-3" id="tg-sb-sidebar">
<ul id="mysidebar" class="nav">
<li class="sidebarTitle">ib-ruby </li>
<li>
<a title="Overview" href="#">Overview</a>
<ul>
<li><a title="Get started" href="index.html">Get started</a></li>
<li><a title="Introduction" href="ibruby_introduction.html">Introduction</a></li>
<li><a title="About the ib-ruby project" href="ibruby_about.html">About the ib-ruby project</a></li>
<li><a title="Support" href="ibruby_support.html">Support</a></li>
</ul>
</li>
<li>
<a title="Release Notes" href="#">Release Notes</a>
<ul>
<li><a title="ib-api 972 gem release" href="ibruby_release_notes_api_972_gem.html">ib-api 972 gem release</a></li>
<li><a title="ib-symbols 1.0" href="ibruby_release_notes_symbols_1.html">ib-symbols 1.0</a></li>
</ul>
</li>
<li>
<a title="Installation" href="#">Installation</a>
<ul>
<li class="active"><a title="About Ruby, Gems, Bundler, etc." href="ibruby_about_ruby_gems_etc.html">About Ruby, Gems, Bundler, etc.</a></li>
<li><a title="Install on Mac" href="ibruby_install_on_mac.html">Install on Mac</a></li>
<li><a title="Install on Windows" href="ibruby_install_on_windows.html">Install on Windows</a></li>
</ul>
</li>
<!-- if you aren't using the accordion, uncomment this block:
<p class="external">
<a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
</p>
-->
</ul>
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
<script>$("li.active").parents('li').toggleClass("active");</script>
</div>
<!-- Content Column -->
<div class="col-md-9" id="tg-sb-content">
<div class="post-header">
<h1 class="post-title-main">About Ruby, Gems, Bundler, and other prerequisites</h1>
</div>
<div class="post-content">
<div class="summary">Ruby is a programming language you must have on your computer in order to run ib-ruby. Ruby has various gems (or plugins) that provide various functionality. Each ib-ruby project usually requires certain gems.</div>
<!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. -->
<script>
$( document ).ready(function() {
// Handler for .ready() called.
$('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3,h4' });
/* this offset helps account for the space taken up by the floating toolbar. */
$('#toc').on('click', 'a', function() {
var target = $(this.getAttribute('href'))
, scroll_target = target.offset().top
$(window).scrollTop(scroll_target - 10);
return false
})
});
</script>
<div id="toc"></div>
<a target="_blank" rel="noopener" href="https://github.com/ib-ruby/ib-doc/blob/gh-pages/pages/ibruby/ibruby_about_ruby_gems_bundler.md" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
<h2 id="about-ruby">About Ruby</h2>
<p><strong><em>ib-ruby</em></strong> runs on Ruby, a programming language. You have to have Ruby on your computer in order to run Ruby-based programs like <strong><em>ib-ruby</em></strong>. Ruby is installed on the Mac by default, but you must add it to Windows.</p>
<p>Its highly recommended to use a <a href="https://en.wikipedia.org/wiki/Ruby_Version_Manager">Ruby Version Manager</a>. Thus
pevents any interference of <strong><em>ib-ruby</em></strong> with other ruby-applications.</p>
<h2 id="about-ruby-gems">About Ruby Gems</h2>
<p>Ruby has a number of plugins referred to as “gems.” Just because you have Ruby doesn’t mean you have all the necessary Ruby gems that your program needs to run. Gems provide additional functionality for Ruby programs. There are thousands of <a href="https://rubygems.org/">Rubygems</a> available for you to use.</p>
<p>Some gems depend on other gems for functionality.</p>
<p>Each gem has a version associated with it, and not all gem versions are compatible with each other.</p>
<h2 id="rubygem-package-managers">Rubygem package managers</h2>
<p><a href="http://bundler.io/">Bundler</a> is a gem package manager for Ruby, which means it goes out and gets all the gems you need for your Ruby programs. If you tell Bundler you need the <a href="https://rubygems.org/gems/ib-extensions">ib-extensions gem</a>, it will retrieve all the dependencies on the <a href="https://rubygems.org/gems/ib-api">ib-api gem</a> as well – automatically.</p>
<p>Not only does Bundler retrieve the right gem dependencies, but it’s smart enough to retrieve the right versions of each gem. For example, if you get the <a href="https://rubygems.org/gems/ib-api">ib-api gem</a> gem, it will retrieve all of these other gems:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> activemodel (6.0.3.4)
activesupport (6.0.3.4)
coderay (1.1.3)
concurrent-ruby (1.1.7)
diff-lcs (1.4.4)
ffi (1.13.1)
formatador (0.2.5)
i18n (1.8.5)
lumberjack (1.2.8)
method_source (1.0.0)
minitest (5.14.2)
nenv (0.3.0)
notiffany (0.1.3)
rake (13.0.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
</code></pre></div></div>
<p>Trying to keep track of which gems and versions are appropriate for your project can be a nightmare. This is the problem Bundler solves. As explained on <a href="http://bundler.io/">Bundler.io</a>:</p>
<blockquote>
<p>Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.</p>
<p>Bundler is an exit from dependency hell, and ensures that the gems you need are present in development, staging, and production. Starting work on a project is as simple as bundle install.</p>
</blockquote>
<h2 id="gemfiles">Gemfiles</h2>
<p>Bundler looks in a project’s “Gemfile” (no file extension) to see which gems are required by the project. The Gemfile lists the source and then any gems, like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>source "https://rubygems.org"
gem 'ib-api'
gem 'ib-extensions'
</code></pre></div></div>
<p>The source indicates the site where Bundler will retrieve the gems: <a href="https://rubygems.org">https://rubygems.org</a>.</p>
<p>The gems it retrieves are listed separately on each line.</p>
<p>Here no versions are specified. Sometimes gemfiles will specify the versions like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem 'kramdown', '1.0'
</code></pre></div></div>
<p>This means Bundler should get version 1.0 of the kramdown gem.</p>
<p>To specify a subset of versions, the Gemfile looks like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem 'jekyll', '~> 2.3'
</code></pre></div></div>
<p>The <code class="language-plaintext highlighter-rouge">~></code> sign means greater than or equal to the <em>last digit before the last period in the number</em>.</p>
<p>Here it will get any gem equal to 2.3 but less than 3.0.</p>
<p>If it adds another digit, the scope is affected:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem `jekyll`, `~>2.3.1'
</code></pre></div></div>
<p>This means to get any gem equal to 2.3.1 but less than 2.4.</p>
<p>If it looks like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem 'jekyll', '~> 3.0', '>= 3.0.3'
</code></pre></div></div>
<p>This will get any Jekyll gem between versions 3.0 and up to 3.0.3.</p>
<p>See this <a href="http://stackoverflow.com/questions/5170547/what-does-tilde-greater-than-mean-in-ruby-gem-dependencies">Stack Overflow post</a> for more details.</p>
<h2 id="gemfilelock">Gemfile.lock</h2>
<p>After Bundler retrieves and installs the gems, it makes a detailed list of all the gems and versions it has installed for your project. The snapshot of all gems + versions installed is stored in your Gemfile.lock file, which might look like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GEM
remote: https://rubygems.org/
specs:
activemodel (6.0.3.4)
activesupport (= 6.0.3.4)
activesupport (6.0.3.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
coderay (1.1.3)
concurrent-ruby (1.1.7)
diff-lcs (1.4.4)
ffi (1.13.1)
formatador (0.2.5)
guard (2.16.2)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.7.3)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8)
method_source (1.0.0)
minitest (5.14.2)
nenv (0.3.0)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
rake (13.0.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-collection_matchers (1.2.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.9.3)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
shellany (0.0.1)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
value_semantics (3.6.0)
zeitwerk (2.4.0)
PLATFORMS
ruby
DEPENDENCIES
bundler (~> 1.17)
guard
guard-rspec
ib-api!
ox!
rake (~> 13.0)
rspec
rspec-collection_matchers
rspec-its
value_semantics
BUNDLED WITH
1.17.3
</code></pre></div></div>
<p>You can always delete the Gemlock file and run Bundle install again to get the latest versions. You can also run <code class="language-plaintext highlighter-rouge">bundle update</code>, which will ignore the Gemlock file to get the latest versions of each gem.</p>
<p>To learn more about Bundler, see <a href="http://bundler.io/rationale.html">Bundler’s Purpose and Rationale</a>.</p>
<div class="tags">
<b>Tags: </b>
<a href="tag_getting_started.html" class="btn btn-default navbar-btn cursorNorm" role="button">getting_started</a>
<a href="tag_troubleshooting.html" class="btn btn-default navbar-btn cursorNorm" role="button">troubleshooting</a>
</div>
</div>
<hr class="shaded"/>
<footer>
<div class="row">
<div class="col-lg-12 footer">
©2020 ib-ruby. All rights reserved. <br />
Site last generated: Oct 26, 2020 <br />
<p><img src="images/company_logo.png" alt="Company logo"/></p>
</div>
</div>
</footer>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
<!-- /#main -->
</div>
</body>
</html>