noobineer has quit [Remote host closed the connection]
jottr_ has quit [Ping timeout: 240 seconds]
gizmore has joined #ruby
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
gizmore|2 has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
guacamole has joined #ruby
pastorinni has quit [Ping timeout: 264 seconds]
noobineer has joined #ruby
Guest41553 has quit [Ping timeout: 256 seconds]
cyberg has quit [Quit: Leaving]
dinfuehr_ has quit [Ping timeout: 264 seconds]
duderonomy has joined #ruby
Olipro has joined #ruby
Olipro is now known as Guest59525
JoshS has quit [Remote host closed the connection]
JoshS has joined #ruby
SeepingN has quit [Remote host closed the connection]
alfiemax has joined #ruby
phaul has quit [Ping timeout: 264 seconds]
herbmillerjr has joined #ruby
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
DTZUZU has quit [Ping timeout: 256 seconds]
yxhuvud has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
\void has quit [Quit: So long, and thanks for all the fish.]
adgtl has joined #ruby
mahlon has joined #ruby
matthewd has joined #ruby
octomancer has joined #ruby
qyliss has joined #ruby
infernix has joined #ruby
cpallares has joined #ruby
oz has joined #ruby
afisher has joined #ruby
voker57 has joined #ruby
S007 has joined #ruby
havenwood has joined #ruby
RushPL has joined #ruby
mostlybadfly has joined #ruby
aarongodin has joined #ruby
volix has joined #ruby
jokester has joined #ruby
Majost has joined #ruby
redlegion[m] has joined #ruby
plexigras has joined #ruby
dan64 has joined #ruby
lipoqil has joined #ruby
yeticry has joined #ruby
Lloyd has joined #ruby
christianmello has joined #ruby
heftig has joined #ruby
WhereIsMySpoon has joined #ruby
jwheare has joined #ruby
nettie has joined #ruby
rideh has joined #ruby
hahuang65 has joined #ruby
cats has joined #ruby
_derpy has joined #ruby
ByronJohnson has joined #ruby
rubemlrm has joined #ruby
xenops has joined #ruby
cjohnson has joined #ruby
ckrailo has joined #ruby
DTZUZU has joined #ruby
redlegion[m] has quit [Changing host]
redlegion[m] has joined #ruby
plexigras has quit [Max SendQ exceeded]
Psybur has quit [Remote host closed the connection]
jyaworski has joined #ruby
JoshS has quit [Remote host closed the connection]
plexigras has joined #ruby
Psybur has joined #ruby
JoshS has joined #ruby
epochwolf has quit [Ping timeout: 260 seconds]
zalipuha[m] has quit [Ping timeout: 248 seconds]
haylon_ has quit [Ping timeout: 245 seconds]
Hanma[m] has quit [Ping timeout: 240 seconds]
aviraldg has quit [Ping timeout: 240 seconds]
luminousnine has quit [Ping timeout: 255 seconds]
luna_x[m] has quit [Ping timeout: 255 seconds]
KevinMGranger has quit [Ping timeout: 252 seconds]
Giphy[m] has quit [Ping timeout: 252 seconds]
jonjits[m] has quit [Ping timeout: 256 seconds]
velu_aon[m] has quit [Ping timeout: 248 seconds]
redlegion[m] has quit [Ping timeout: 246 seconds]
torarne has quit [Ping timeout: 256 seconds]
turt2live has quit [Ping timeout: 252 seconds]
iceskins[m] has quit [Ping timeout: 255 seconds]
dizzy1or5[m] has quit [Ping timeout: 260 seconds]
kinduff[m] has quit [Ping timeout: 248 seconds]
epochwolf has joined #ruby
JoshS has quit [Remote host closed the connection]
JoshS has joined #ruby
SteenJobs has quit [Quit: peaceee]
workmad3 has joined #ruby
bmurt has joined #ruby
haylon has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
bmurt has quit [Ping timeout: 256 seconds]
Puffball has quit [Remote host closed the connection]
jyaworski has quit [Ping timeout: 256 seconds]
fhmax has joined #ruby
n0m4d1c_ has joined #ruby
uplime is now known as watermelon
noobineer has quit [Ping timeout: 256 seconds]
BTRE has quit [Read error: Connection reset by peer]
n0m4d1c has quit [Ping timeout: 260 seconds]
watermelon is now known as uplime
n0m4d1c_ has quit [Read error: Connection reset by peer]
BTRE has joined #ruby
n0m4d1c has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
zalipuha[m] has joined #ruby
Dimik has quit [Ping timeout: 245 seconds]
Bonjourm8 has quit [Quit: Leaving]
b100s has joined #ruby
tdy has quit [Ping timeout: 264 seconds]
rshetty has joined #ruby
jyaworski has joined #ruby
rshetty has quit [Remote host closed the connection]
Psybur has quit [Ping timeout: 260 seconds]
marr has quit [Ping timeout: 240 seconds]
<b100s>
Hello! I would like to ask what is origin of request.ip in sinatra app? I've checked source code, looks like it's simply REMOTE_ADDR header https://github.com/rack/rack/blob/master/lib/rack/request.rb#L256 . Also I've checked by `nc -l ..` request headers, but I didn't find them. But output of `puts JSON.pretty_generate(request.env)` contains them. What does generate this header for sinatra request object ?
rexan has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
alfiemax has joined #ruby
Giphy[m] has joined #ruby
redlegion[m] has joined #ruby
turt2live has joined #ruby
Hanma[m] has joined #ruby
torarne has joined #ruby
luna_x[m] has joined #ruby
haylon_ has joined #ruby
iceskins[m] has joined #ruby
jonjits[m] has joined #ruby
KevinMGranger has joined #ruby
velu_aon[m] has joined #ruby
aviraldg has joined #ruby
luminousnine has joined #ruby
SynSynack has quit [Remote host closed the connection]
dizzy1or5[m] has joined #ruby
kinduff[m] has joined #ruby
SynSynack has joined #ruby
rshetty has joined #ruby
wald0 has quit [Quit: Lost terminal]
jyaworski has quit [Ping timeout: 256 seconds]
jimmylu2333-rpi3 has quit [Ping timeout: 260 seconds]
<ruby[bot]>
donofrio: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<lembron>
hi there, im digging over scripts to understand stuff -- what does a single @varname mean do? its not in a place of return, and doesnt get anything assigned or whatever
<lembron>
does that some kinda init / load?
<lembron>
googling that with a fitting keyword turns out kinda hard ;D
jyaworski has quit [Ping timeout: 248 seconds]
postmodern has quit [Quit: Leaving]
oleo2 has joined #ruby
<phaul>
referencing an instance variable. If it's not in a place of return, and it's not used in any way, that's valid ruby, but then that line does nothing. Do a gist example, so we can confirm, looking at the code
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jyaworski has joined #ruby
synthroi_ has joined #ruby
oleo2 has quit [Ping timeout: 255 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<lembron>
OS_FACTS exists from the helper, but afaik all that stuff is case-sensitve
jshjsh has joined #ruby
synthroid has quit [Ping timeout: 260 seconds]
rshetty has quit [Remote host closed the connection]
<phaul>
I agree it looks weird. I don't know. I would put a debugger before that line, get a byebug prompt and look at the value / class of @os_facts. also it seems to do it on the top level scope - therefore main?
rexan has joined #ruby
JoshS has quit [Ping timeout: 255 seconds]
<lembron>
the file is run from inside rspec later on, so "top scope" is somewhat relative i assuem...
<lembron>
but knowing it doesnt do any secret magic may be all i needed for now =) thanks
venmx has quit [Ping timeout: 260 seconds]
<phaul>
does it work if you just remove it? :)
ecuanaso has joined #ruby
rshetty has joined #ruby
jrafanie has joined #ruby
k0mpa has joined #ruby
rshetty has quit [Ping timeout: 268 seconds]
jyaworski has quit [Ping timeout: 264 seconds]
<apeiros>
lembron: looks like an accidental leftover. it does nothing in ruby.
<lembron>
well, its very nicely in each and every of these files there... :D
<lembron>
"ill just leave it in" i guess :P
<apeiros>
oh? it's in multiple places?
<apeiros>
maybe they abuse it
<apeiros>
as in: use it like a marker of some sort
nadir has quit [Quit: Connection closed for inactivity]
bmurt has joined #ruby
tvw has joined #ruby
lypsis has joined #ruby
biberu has joined #ruby
qba73 has joined #ruby
tcopeland has joined #ruby
Erlingur has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
coderphive has joined #ruby
lypsis has quit [Client Quit]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pd2000 has joined #ruby
pd2000 has quit [Max SendQ exceeded]
<dminuoso>
Perhaps there's some set_trace_func magic going on ¯\_(ツ)_/¯
pd2000 has joined #ruby
tvw has quit []
duderonomy has quit [Ping timeout: 248 seconds]
alex`` has quit [Ping timeout: 256 seconds]
HoloIRCUser2 has quit [Ping timeout: 276 seconds]
ToasttifyRB has quit [Ping timeout: 276 seconds]
Erlingur has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
Guest14032 has joined #ruby
<apeiros>
dminuoso: or some rspec tool which inspects the source (e.g. by running it through one of the ruby parsers - a lone ivar should be easy to detect)
alfiemax has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
alex`` has joined #ruby
rsh has joined #ruby
<dminuoso>
Still a weird thing to do.
lypsis has joined #ruby
james__ has joined #ruby
apparition has joined #ruby
rexan has quit [Read error: Connection reset by peer]
harry_ has quit [Remote host closed the connection]
shpoont has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
harrycs has joined #ruby
harrycs has quit [Remote host closed the connection]
harrycs has joined #ruby
harrycs has quit [Remote host closed the connection]
netherwolfe has joined #ruby
harrycs has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
cyberg has joined #ruby
Strepsils has quit [Ping timeout: 256 seconds]
ellcs has joined #ruby
duderonomy has joined #ruby
rexan has quit [Ping timeout: 276 seconds]
rexan has joined #ruby
jeffreylevesque has joined #ruby
xenops has quit [Ping timeout: 246 seconds]
dionysus69 has quit [Ping timeout: 256 seconds]
cschneid has joined #ruby
Esa_ has joined #ruby
Mosselman has quit [Ping timeout: 256 seconds]
rshetty has quit [Remote host closed the connection]
alfiemax has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
dviola has joined #ruby
stormpack has joined #ruby
rshetty has joined #ruby
karapetyan has quit [Ping timeout: 256 seconds]
shuforov has quit [Ping timeout: 268 seconds]
kn-928 has quit [Ping timeout: 256 seconds]
ryan_ford has quit [Quit: WeeChat 1.4]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 276 seconds]
Sauvin has joined #ruby
synthroi_ has quit [Remote host closed the connection]
desperek has joined #ruby
rexan has quit [Ping timeout: 260 seconds]
za1b1tsu has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
cremes77 has joined #ruby
govg has quit [Ping timeout: 256 seconds]
Mosselman has joined #ruby
kn-928 has joined #ruby
stormpack_ has joined #ruby
nadir has joined #ruby
_yohji_ has quit [Remote host closed the connection]
cagomez has joined #ruby
jrafanie has joined #ruby
stormpack has quit [Ping timeout: 276 seconds]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
pocketprotector- has quit [Changing host]
pocketprotector- has joined #ruby
pocketprotector- is now known as pocketprotector
oleo has quit [Quit: Leaving]
konsolebox has joined #ruby
yeticry has quit [Ping timeout: 246 seconds]
cagomez has quit [Ping timeout: 248 seconds]
cagomez has joined #ruby
yeticry has joined #ruby
apparition has quit [Quit: Bye]
govg has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
venmx has joined #ruby
kapil___ has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
thinkpad has quit [Ping timeout: 260 seconds]
thinkpad has joined #ruby
Mosselman has quit [Ping timeout: 240 seconds]
cremes77 has quit [Quit: cremes77]
schneider has quit [Ping timeout: 240 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
cremes77 has joined #ruby
erlend has quit [Ping timeout: 248 seconds]
erlend has joined #ruby
qba73 has quit [Ping timeout: 260 seconds]
iceden has joined #ruby
<clemens3>
Ruby 2.4 doesn't have File.exists? method anymore?!!!
synthroid has joined #ruby
Guest16187 has quit [Quit: Something went wrong because I left.]
Omnilord has joined #ruby
<dminuoso>
clemens3: It does have it, it's just deprecated. Read the message.
<clemens3>
ah, my bad
<clemens3>
typo
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chocoelho has joined #ruby
oleo has joined #ruby
<clemens3>
dminuoso: if it is deprecated, it means future versions will break a lot of my software
<clemens3>
if it means it will be removed some day
<dminuoso>
clemens3: That's the purpose of deprecation warnings.
<clemens3>
to break existing software?
<dminuoso>
clemens3: No to give you years to fix your damn software for upcoming changes.
pd2000 has joined #ruby
<clemens3>
my software was never broken, and is not damned..
<clemens3>
but ruby seems to be damned and makes my look for some escape route
<clemens3>
s/my/me/
schneider has joined #ruby
pd2000 has quit [Remote host closed the connection]
<dminuoso>
clemens3: That's called software maintainance. Some things are historical baggage that need to be thrown away for consistency or better behavior.
alex`` has quit [Ping timeout: 260 seconds]
<clemens3>
well, I have no problem with File.exists?
<dminuoso>
So Ruby lets you know years in advance that things will change at some point. It's not too much to ask for, when Ruby tells you to replace method calls from exists? to exist?
guille-moe has quit [Ping timeout: 264 seconds]
troys has joined #ruby
<clemens3>
you ask me to change all existing software.. some might be shiped and god knows where they are
<dminuoso>
clemens3: If you are unable to maintain your software, that's your issue really.
<dminuoso>
But this deprecation warning has been in Ruby for 5 years now.
<clemens3>
dminuoso: in the documentation does not even say use exist? instead...
<dminuoso>
clemens3: In 2.1 exists? is not named, and after that it's explicitly documented as deprecated.
<dminuoso>
clemens3: 2.4 has had major API changes that break most native extensions too.
<dminuoso>
But really. If you dont know what software you have shipped, how do you ever maintain your software? How do you ship security patches?
<clemens3>
aeh, I was wary of upcoming 3.. seems I will stay a bit with 2.3 and then see where to move
<dminuoso>
clemens3: Besides, it's a contract thing mostly. Either you have a contract for some kind of maintenance/support, then it's your business to keep track of your software/deployment.
<dminuoso>
Or you dont have any such contracts, in which case its not your business anyway.
<dminuoso>
So it's your problem really. =)
<clemens3>
it is my problem
<clemens3>
and I see with whom I do form a relation... I ditched Rails long time ago because terrible backwards compatibility.. Ruby has been no comparison so far..
Mosselman has joined #ruby
<clemens3>
but I am certainly on the watch..
<elomatreb>
This particular one is so minor you can probably fix it with a sed
<dminuoso>
In a way the reluctance to break backwards compatibility is a downside of ruby.
<dminuoso>
It limits many new features.
<clemens3>
I am not looking for new features, I am happy the way Ruby is
ramfjord has joined #ruby
Omnilord has quit [Quit: Something went wrong because I left.]
suukim has joined #ruby
<dminuoso>
clemens3: Ruby is one of the slowest languages on the block, with no type guarantees, piss poor parallelism...
<dminuoso>
And a very inconsistent core library due to historical reasons.
darkhanb has joined #ruby
<dminuoso>
iow: plenty of things one could improve - but without making some backwards breaking changes it's hard to address these
<clemens3>
make a new language and call it something else
<dminuoso>
we also have absolutely no module system - forced to effectively "eval" all code together (in hopefully the right order)
<dminuoso>
there's plenty things that are wrong in ruby
<clemens3>
or use one of the fast ones, suporting types or parallelism
Mosselman has quit [Ping timeout: 255 seconds]
orbyt_ has joined #ruby
schneider has quit [Ping timeout: 256 seconds]
<dminuoso>
clemens3: Why not introduce features to Ruby to allow for such things?
<dminuoso>
=)
<dminuoso>
Both are lovely things.
schneider has joined #ruby
<clemens3>
Yes, just don't break backwards compatibility.. e.g. a sed would fix my code easily, but File.exists? can stay as it is and would prevent zero progress in other areas
<dminuoso>
And it takes about 5 seconds to fix your codebase. You gain a cleaner core API that is not cluttered by silly historic accidents.
<elomatreb>
It's a question of consistency, if we have aliases that make methods form pseudo-sentences for one method, we should introduce it for all predicate methods
<clemens3>
and it takes zero seconds to leave it as it is.. and the ri File.exists? does not even say what to use instead..
<elomatreb>
Or for none of them
[Butch] has joined #ruby
<clemens3>
arg, stay away with pseudo sentences..
<clemens3>
this is historical.. add exist? if it makes you happy.. but history is not too bad a thing
karapetyan has quit [Remote host closed the connection]
schneider has quit [Ping timeout: 256 seconds]
<clemens3>
and at some point, just create a new language.. fine with me.. Ruby was new at some point, C was also new at some point, some people moved to Ruby, some stayed with c..
chocoelho has quit [Ping timeout: 256 seconds]
<clemens3>
so don't bork everything to you imagined Utopia.. you don't know yet what will work and what not.. some just want to use what is already here
<dminuoso>
clemens3: Just use `sed`. Your 5 seconds is not as important as having a clean API.
<clemens3>
but of course, you can do what you want with Ruby, just as I can decide to use it or not
karapetyan has joined #ruby
<dminuoso>
Feel free to not use it then.
<clemens3>
I will
<dminuoso>
clemens3: Just consider that the Ruby team also has to be concerned about how Ruby appears to people deciding on a language. If you stare at a core library and are confused by an inconsistent mess of function names, it might discourage people from using it.
<dminuoso>
If the core API itself looks like a mess..
cagomez has quit [Remote host closed the connection]
<clemens3>
yes, I wish you a lot of new users
herbmillerjr has quit [Quit: Konversation terminated!]
<phaul>
I have an RSpec "extension" idea. It's basically the ability of instead of manually nesting contexts into each other and spell out every case in a flat manner, just let the system traverse the cross product of the given contexts.
<phaul>
has this been done?
<phaul>
is it a good or bad idea?
Erlingur has joined #ruby
cagomez has quit [Ping timeout: 276 seconds]
<phaul>
I guess I should ask this on #rspec (nm)
Kero__ has joined #ruby
Kero__ has quit [Client Quit]
cremes77 has quit [Quit: cremes77]
cremes77 has joined #ruby
eckhardt_ has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
tolerablyjake has joined #ruby
dr3w_ has joined #ruby
za1b1tsu has quit [Quit: Leaving]
ldepandis has joined #ruby
SanguineAnomaly has joined #ruby
jshjsh has quit [Quit: Leaving]
cremes77 has quit [Quit: cremes77]
pd2000 has joined #ruby
cremes77 has joined #ruby
chocoelho has quit [Quit: Konversation terminated!]
ryzokuken has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
pilne has joined #ruby
Code4Dopamine has quit [Quit: Page closed]
Erlingur has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AndBobsYourUncle has joined #ruby
silviu has joined #ruby
SeepingN has joined #ruby
rexan has joined #ruby
suukim has quit [Quit: Konversation terminated!]
sanscoeur has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
roshanavand has joined #ruby
sanscoeur has joined #ruby
cremes77 has quit [Quit: cremes77]
shuforov has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
workmad3_ has joined #ruby
cremes77 has joined #ruby
cdg has quit [Remote host closed the connection]
Asher1 has joined #ruby
tomphp has joined #ruby
Asher has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
alfiemax_ has joined #ruby
erlend has quit [Ping timeout: 248 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
alfiemax has quit [Ping timeout: 256 seconds]
cagomez has quit [Remote host closed the connection]
alex`` has joined #ruby
jamesaxl has joined #ruby
erlend has joined #ruby
John_Ivan has joined #ruby
John_Ivan has quit [Changing host]
John_Ivan has joined #ruby
Mosselman has joined #ruby
lytol has joined #ruby
sameerynho has joined #ruby
nowhere_man has joined #ruby
nowhereman_ has quit [Ping timeout: 255 seconds]
alex`` has quit [Quit: WeeChat 2.1]
KeyJoo has quit [Ping timeout: 260 seconds]
jyaworski has joined #ruby
ramfjord has joined #ruby
Asher1 has quit [Quit: Leaving.]
pd2000 has quit [Remote host closed the connection]
pd2000 has joined #ruby
rshetty has quit [Remote host closed the connection]
synthroid has quit [Remote host closed the connection]
ltt has joined #ruby
Asher has joined #ruby
jyaworski has quit [Ping timeout: 260 seconds]
cremes77 has quit [Quit: cremes77]
sanscoeur has quit [Read error: Connection reset by peer]
<EvanR>
so I wrote a program in ruby, but using rbenv to get ruby 2.5.1 and bundler to get gems
<EvanR>
how do i deploy it on a linux system so you can just use it from the command line ?
<EvanR>
or shell out to it
<EvanR>
is there a static linker or something
james__ has quit [Client Quit]
cremes77 has quit [Quit: cremes77]
<dminuoso>
EvanR: The usual way is to package the program as a gem.
cremes77 has joined #ruby
<dminuoso>
Alternatively you could use bundler
<dminuoso>
Travelling Ruby lets you ship stand alone packages, but its a bit annoying to set up and has a rather limited subset of native extensions available.
<dminuoso>
Also hey there =)
krawchyk has joined #ruby
<EvanR>
package the program as a gem you say
<dminuoso>
EvanR: Is the program just a one-file program?
<EvanR>
no, its a main file, a library routines file, and has two data files in the directory which it needs
<EvanR>
and sometimes it writes to a file in the dir
<dminuoso>
Do you want to avoid the external depedency on Ruby?
<EvanR>
and it uses a set of gems
jgpawletko has quit [Quit: jgpawletko]
<EvanR>
im fine with depending on ruby 2.5.1, but its just not going to be installed on the target system
<EvanR>
and the gems will be incompatible with the system gems
rexan has quit [Ping timeout: 255 seconds]
<dminuoso>
EvanR: bundler is kind of like stack.
<dminuoso>
EvanR: If no ruby is available at the remote machine, you're basically "stuck" to travelling-ruby or alternative solutions.
<EvanR>
there is a ruby of course
<dminuoso>
Ah.
<EvanR>
ruby 1.9.3p484
Psybur has joined #ruby
<EvanR>
it wont run the program
<EvanR>
my first idea was to install rbenv, put all this in a side dir, and write a shell script which cds into it and pipes stdin to the ruby -I. foo.rb
<EvanR>
but i thought it had to be too absurd to be right
<dminuoso>
EvanR: well you can safely toss rbenv aside, it's unnecessarily complex, hooks your shell and does other weird things.
<EvanR>
right, whats the latest ruby version manager of the week
<dminuoso>
ruby-install for installing rubies, chruby for switching them. both are unlikely to be superseeded any time soon due to their simplicity.
<EvanR>
chruby ok
<dminuoso>
chruby is essentially just a 100 lines shell script that changes your PATH =)
<EvanR>
suuuure...
<EvanR>
i mean, from here it looks like a hall of mirrors. "rvm sucks use rbenv"
<EvanR>
"rbenv sucks use chruby"
<EvanR>
just waiting for the next metalevel
<dminuoso>
Heh
<apeiros>
chruby sucks, use rvm
<EvanR>
how do any of these help my situation?
<apeiros>
there. circle complete
krawchyk has quit [Ping timeout: 268 seconds]
* apeiros
actually does use rvm in production, it's fine. but so is any of the other.
<dminuoso>
EvanR: It doesn't, but I wouldn't be a good rubyist if I didn't try and convert people to chruby.
<dminuoso>
Jokes aside
<dminuoso>
EvanR: You can use version switching (which all of these three versions support) to automatically picky ruby 2.5
<dminuoso>
EvanR: Furthermore, with bundler you can load the bundle from inside ruby with some `require 'bundler/setup'; Bundler.require(:default)`
<EvanR>
lets say i want to execute a command... something, with stdin "lots of important info\n"
<EvanR>
how do we make that a possibility now that the command was written in ruby 2.5.1 and uses gems
<EvanR>
ok... use bundler in the program
<EvanR>
but what about the ruby version
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<EvanR>
#!/bin/ruby-2.5.1 ;_;
<dminuoso>
EvanR: It's a kind of an achilles heel. Normally you'd specify spec.required_ruby_version if shipping a gem, or the `ruby` directive if using bundler
<EvanR>
ok lets say i do that
<EvanR>
now how would i run the program on the target system
alfiemax_ has quit [Remote host closed the connection]
<dminuoso>
EvanR: .ruby-version might force automatic ruby version switching if the user has the necessary machinery though.
<EvanR>
is "automatic ruby version switch" a specific technology
<EvanR>
up to this point i thought this was just a vague concept that we want
<apeiros>
EvanR: most version switchers will respect a .ruby-version file in your project
<EvanR>
i have this file
<dminuoso>
EvanR: chruby/rbenv/rvm all (?) support .ruby-version files. So if the user has the manage (with the appropriate configuration), it will pick the appropriate ruby as specified in the file.
<dminuoso>
But if they have raw ruby, no luck.
<EvanR>
please bear with me
<apeiros>
well, you can still ensure the ruby version in your gem spec and in your executable (the latter via code, see RUBY_VERSION constant)
* apeiros
🐻 with EvanR
tolerablyjake has joined #ruby
cagomez has joined #ruby
<EvanR>
lets say you have this program running... lets say its written in C++ and is not involved with shell shenanigans or ruby, and it wishes to execute this program and get the stdout/stderr. its not going to CD into a dir and cause a shell environment to update. how is the correct ruby going to be chosen
alfiemax has joined #ruby
<apeiros>
I'd assume you'd make the executable configurable in that program
<apeiros>
and then - while I don't know about chruby or rbenv - with rvm, you'd point it to a wrapper script
<EvanR>
so it has to know where the ruby binary is, and use it
<dminuoso>
EvanR: The problem is you have to know how your ruby is installed.
<apeiros>
rvm automatically creates those, they load everything required to switch to the desired ruby version.
fl3sh has joined #ruby
<dminuoso>
EvanR: You have to be aware of rvm, rbenv and chruby switching mechanics - and you have to inspect whether any of them has the desired version available.
<EvanR>
ok this answers my question
<apeiros>
the alternative variant is that you run that program in an env which is already properly switched
ltt has quit [Ping timeout: 276 seconds]
<dminuoso>
EvanR: Like I said, it's an achilles heel - there is no good solution.
<EvanR>
yeah i cant
<apeiros>
and then rely on plan `ruby` to run the right version
<apeiros>
*plain
<EvanR>
because... ready for it? the first program is written in ruby, 2.1.2 :)
synthroi_ has joined #ruby
<dminuoso>
EvanR: Any chance you can modify the program to be compatible with 1.9?
<EvanR>
it cant be in both environments
<EvanR>
dminuoso: no, its impossible
<EvanR>
latest google gems are not backwards compatible
<apeiros>
run a wrapper
agent_white has quit [Remote host closed the connection]
<dminuoso>
EvanR: Oh my. You were spending this morning on _ruby_ documentation?
<EvanR>
thats what im going to do
<EvanR>
yes
<apeiros>
change the env in the wrapper
<EvanR>
basically
<dminuoso>
EvanR: Then my twitter quote I linked to you earlier is even more hilarious! :-)
<dminuoso>
EvanR: Are there any native extensions? And whats the earliest ruby you can be compatible to?
<EvanR>
i should have wrote this second program in a compiled language and just installed a binary!
<fl3sh>
hi, what is the best and easiest way to create standalone bindry? I tried ruby-packer and rb2exe, but both falied. I am traing to create binary from redis-trib.rb
<apeiros>
meh, you make it sound like changing the ruby version was some really difficult task
<EvanR>
good timing
<dminuoso>
fl3sh: travelling-ruby is the least brittle way
alfiemax has quit [Ping timeout: 240 seconds]
synthroid has quit [Ping timeout: 240 seconds]
<dminuoso>
EvanR: My two questions are aimed to figuring out whether travelling-ruby (which I mentioned at the beginning) is an option for you.
<EvanR>
oh i pretty much missed that referenced
<EvanR>
apeiros: like i said, the first thing i was going to do was have a shell script cd into the dir and pipe stdin through
<EvanR>
but if i know where ruby is... this is even easier
shuforov has joined #ruby
<EvanR>
dminuoso: i doubt there are any native extensions
sammi` has joined #ruby
<dminuoso>
EvanR: Are you fine with 2.2?
<dminuoso>
EvanR: I would simply go with .ruby-version, document that the user has to provide an appropriate ruby version and a ruby-version manager, ensure the correct ruby version is running through bundler/gemspec - and that's it.
zacts has quit [Quit: WeeChat 1.9.1]
<EvanR>
im the only user
<EvanR>
this just happens to be a production system not development
<EvanR>
so was wondering if theres a saner way
zacts has joined #ruby
<dminuoso>
EvanR: then just deploy ruby 2.5 in such a way, that it shadows the system installation.
<dminuoso>
That's the "usual" way.
<EvanR>
i dont really know the diff between anything from 2.1 to 2.5
tomaw_ is now known as tomaw
<EvanR>
by deploy in such a way that it shadows, you mean something like chruby or rbenv
<EvanR>
PATH tricks
<dminuoso>
EvanR: Yes. chruby just changes the front of your PATH
<dminuoso>
So that your shell finds the ruby version in the chruby managed path before the system bin directory.
<dminuoso>
You can either do that by hand, or use `chruby` itself.
Mosselman has quit [Ping timeout: 256 seconds]
<EvanR>
if you subscribe to chruby, how do you install the various versions of ruby
<ruby[bot]>
r3my: we in #ruby do not like irccloud.com, it has no syntax highlighting, distracting formatting and loads slowly for most. Please use https://gist.github.com
<dminuoso>
EvanR: The reason I suggest ruby-install/chruby is because the stack is simple to reason about. With rbenv there's also a huge pile of things that can go wrong, and you have to _try_ things in a random order to know which one.
<dminuoso>
It's not just a religious point of view, it's a pragmatic one.
<EvanR>
be that as it may, i am now frustrated that i dont understand whats going on with this setup
<EvanR>
which cant be solved if i just use a working tool :)
alfiemax has joined #ruby
<EvanR>
can chruby be used at the same time as rbenv ?
pd2000 has quit [Remote host closed the connection]
pd2000 has joined #ruby
MzrE has joined #ruby
<dminuoso>
EvanR: rbenv does a weird machinery with ruby shims, it hooks your shell, and it loaded with lots of weird things.
pr0ton has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<EvanR>
i thought rvm did that, people hated it, so rbenv was invented because of it
cdg_ has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
pd2000 has quit [Remote host closed the connection]
pd2000 has joined #ruby
<miah>
rbenv uses a bunch of shims, its not too different
<miah>
my only complaint with that article is that he uses ruby-build rather than ruby-install =)
<miah>
need to just take that entire postmodern dive
quobo has joined #ruby
<dminuoso>
EvanR: With the chruby/ruby-install stack, your problems boil down to just one thing: understanding https://cdn-images-1.medium.com/max/1600/1*zv2wzn0nZHyPhcyq4glHbA.png
<EvanR>
like... on my shell, the first thing in my path are the rbenv shims. but in my wrapper shells script being run from ruby (2.1.2) open3, i have rubygems stuff and other rbenv stuff in front of it, in PATH
<EvanR>
i dont understand
<EvanR>
where thats coming from, and why it stops rbenv from functioning
<fl3sh>
Traveling ruby supports only ruby 2.1.x?
<sparr>
if !by['group'].nil? && by['group'] != :undef
<dminuoso>
fl3sh: 2.2 is supported at least
ltt has joined #ruby
<sparr>
I'm having trouble with how that line could produce "can't convert String into Integer"
<EvanR>
dminuoso: r.e. that diagram... are you saying i have to know MORE than that to understand rbenv o_O
<dminuoso>
EvanR: Yes.
<sparr>
I expect "by" to be a hash, but even if it's not, what could it be that would produce that error??
jeffreylevesque has quit [Ping timeout: 240 seconds]
<dminuoso>
EvanR: Because chruby has no magic. It's a simple "change PATH so that ruby points to version xyz" with a simple shell function. So it just boils down to calling that shell function.
jeffreylevesque has joined #ruby
pd2000 has quit [Remote host closed the connection]
<dminuoso>
Which means you just need to know where to place that shell command. Or, if you want to create an executable file you can do it from there and completely ignore that diagram.
<dminuoso>
No problems whatsoever.
<phaul>
>> [1]['x']
pd2000 has joined #ruby
<ruby[bot]>
phaul: # => no implicit conversion of String into Integer (TypeError) ...check link for more (https://eval.in/981517)
<phaul>
sparr: ^
<EvanR>
dminuoso: this whole exercise is so i dont have to mess with the ruby version and gem versions of any of the existing ruby ;_;
bmurt has joined #ruby
agent_white has joined #ruby
<dminuoso>
EvanR: You dont with chruby.
jamesaxl has quit [Read error: Connection reset by peer]
<sparr>
phaul: thanks, I'll play with that example and see if I can suss out the behavior
<dminuoso>
EvanR: ruby-install by default installs into a local rubies directory. chruby will update the shells PATH to that. If you dont do this in any of the files shown in the diagram, none of your users will be any wiser.
<sparr>
aha!
<sparr>
my `by` is an array, and it's trying to turn `group` into an index
ta_ has quit [Read error: Connection reset by peer]
<dminuoso>
rbenv/rvms Just Work™ until they Just Dont Work™
<EvanR>
"I don't know whether this is a bug, or how to solve it. It seems unsolvable from rbenv. If from a ruby process you want to shell out to rbenv, you would need to edit ENV['PATH'] first to restore it to the pristine state."
ta_ has joined #ruby
MzrE has quit [Quit: Leaving]
harry__ has joined #ruby
<EvanR>
its a fatal (imo) issue with rbenv state of the art 2013
<EvanR>
which... is for some reason what i am using
<dminuoso>
Are you forced to use rbenv?
<EvanR>
i wonder what would happen if i upgrade
ta_ has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
<EvanR>
i have a rails app running an ecommerce thing, and right now im just trying to fix a memory leak by reimplemented a particular feature
<EvanR>
redoing the production deployment technology is not high on my priorities ;_;
cagomez has joined #ruby
<EvanR>
and yeah its using rbenv, which is going to stop this thread from being closed
ramfjord has joined #ruby
* EvanR
throws computer through wall
<miah>
=)
harry_ has quit [Ping timeout: 260 seconds]
imode has quit [Ping timeout: 268 seconds]
ledestin has joined #ruby
alfiemax has joined #ruby
brucebag has quit [Quit: brucebag nipped out]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
brucebag has joined #ruby
brucebag has quit [Changing host]
brucebag has joined #ruby
brucebag has quit [Client Quit]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
qba73 has quit []
brucebag has joined #ruby
brucebag has joined #ruby
brucebag has quit [Changing host]
alfiemax has quit [Ping timeout: 268 seconds]
brucebag has quit [Remote host closed the connection]
brucebag has joined #ruby
brucebag has quit [Changing host]
brucebag has joined #ruby
<EvanR>
i see how they could have fixed it
cdg_ has quit [Remote host closed the connection]
<EvanR>
instead of prepending stuff to PATH and leaving it there forever, prepend every time you run ruby, forming a telescoping sandwich of alternating ruby versions
rsh has quit [Ping timeout: 276 seconds]
joast has quit [Quit: Leaving.]
<EvanR>
i will slay the **** out of this beast
<dminuoso>
EvanR: And that leaves you with.. chruby. ;-)
imode has joined #ruby
<EvanR>
the "solution" suggested where they unsplice the PATH using a hint from the detected rbenv root, is really bad
<EvanR>
for instance, PATH shenanigans are also happening with haskell stack
james__ has joined #ruby
nowhereman_ has joined #ruby
<dminuoso>
EvanR: There's honestly not much to do to replace rbenv with chruby - even for an already deployed system.
nowhere_man has quit [Ping timeout: 268 seconds]
<dminuoso>
Probably boils down to a) checking whether it uses something like capistrano (and using the chruby plugin for that), and making the appropriate change to whatever init script/variant is used to keep the server up.
<EvanR>
it doesnt have this issue 121 ?
lypsis has joined #ruby
DoubleMalt has joined #ruby
DoubleMalt has quit [Client Quit]
<EvanR>
namely, during ruby runtime, shims are shadowed and dont work, you cant change ruby *again*
<EvanR>
until the program ends
tcopeland has quit [Quit: tcopeland]
imode has quit [Ping timeout: 264 seconds]
AndBobsYourUncle has joined #ruby
<dminuoso>
EvanR: there are no shims with chruby
<sparr>
raise somehash.inspect
jeffreylevesque has quit [Ping timeout: 260 seconds]
<dminuoso>
EvanR: All chruby is, is just a shell function that changes PATH.
<dminuoso>
Nothing more, nothing less.
<sparr>
this should get me the serialized contents of the hash in an exception message?
pr0ton has quit [Quit: pr0ton]
<apeiros>
sparr: yes
<apeiros>
well, "serialized"
<weaksauce>
chruby is great
<apeiros>
it's not really a serialization. just a representation meant for dev's to be readable.
<EvanR>
dminuoso: so what would happen is... youd have two layers of ruby stuff on path?
<dminuoso>
EvanR: Whenever you enter `ruby` shell inspects PATH from left to right. The first directory that contains the appropriate execu§table is picked.
<dminuoso>
It's plain old shell semantics, nothing more.
<sparr>
apeiros: thanks
<EvanR>
change the whole subject for a second... pretend you dont have anything that changes ruby. and you only have 1 ruby version to worry about. whats the proper way to deal with gems. rubygems, bundler?
<dminuoso>
EvanR: bundler
<dminuoso>
(or rubygems)
<EvanR>
is that all super magical?
<dminuoso>
EvanR: bundler is basically like cabal new-build :P
<dminuoso>
or more like stack I guess.
<EvanR>
is that sandbox
<dminuoso>
Yes.
<dminuoso>
Well it can.
<EvanR>
does bundler know about ruby versions
venmx has quit [Ping timeout: 276 seconds]
<dminuoso>
Yes but it cant switch.
<dminuoso>
It can however verify them.
<EvanR>
cool
<EvanR>
how does if at all chruby interact with bundler
<dminuoso>
not at all.
<dminuoso>
well almost.
<EvanR>
ok
<dminuoso>
the `bundler` binary itself has to come from somewhere
<dminuoso>
usually its from some gemset, which chruby will manage along with the ruby version
<EvanR>
gem set .....
<dminuoso>
well gem root if you want
<dminuoso>
ruby gems are tied to ruby versions.
Esa_ has quit []
<EvanR>
when you require bundler, that goes to the one for the version of ruby youre running?
<EvanR>
also are we talking about the hijacked require in rails or
silviu has quit [Remote host closed the connection]
james__ has quit [Quit: This computer has gone to sleep]
Psybur has quit [Ping timeout: 240 seconds]
venmx has joined #ruby
imode has joined #ruby
noobineer has joined #ruby
<dminuoso>
EvanR: Do you want a general or an accurate answer?
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
biberu has quit []
alex`` has quit [Ping timeout: 276 seconds]
<EvanR>
question 1 accurate. question 2 general
lytol has quit [Remote host closed the connection]
<dminuoso>
EvanR: bundler has a so-called deployment mode, which will create a local vendor/bundle directory.
<dminuoso>
Not sure how verion switching interacts with _that_
<dminuoso>
It probably requires pruning and reinstalling, but I could be wrong here.
<dminuoso>
But otherwise yes.
<dminuoso>
Question 2: what hijacked require are you talking about?
<EvanR>
the require "command" in ruby is shadowed in rails
<EvanR>
its not a keyword...
<dminuoso>
Is it?
<apeiros>
no, it's not
<apeiros>
(neither shadowed nor keyword)
<apeiros>
rails hooks up const_missing
<dminuoso>
EvanR: I think you are thinking of the weird autoloading in Rails.
<EvanR>
i am thinking of weird autoloading in rails
<apeiros>
oh…
jrafanie has quit [Ping timeout: 256 seconds]
<apeiros>
while you do, rails still rigs require. I stand corrected
<apeiros>
though that.s a rails4 project. I should check with rails5
<dminuoso>
Oh wait. Not part of official API..
<EvanR>
require is monkeypatched
<EvanR>
lol
<dminuoso>
Though...
<dminuoso>
Not in 5 anymore it seems.
<EvanR>
oh really
<apeiros>
yepp, still is
<dminuoso>
Huh
<apeiros>
5.1.4 here and `$ require` still shows ActiveSupport::Dependencies::Loadable#require
noobineer has quit [Ping timeout: 260 seconds]
<EvanR>
i should start a framework which monkey patches it again
<EvanR>
for the sake of it
<apeiros>
(and yes, I *really* dislike how rails handles requires/const_missing)
<EvanR>
and hide all knowledge of it
<dminuoso>
EvanR: I think it's mostly for reloading work correctly under reloading
<apeiros>
but from my experience, the monkey patching of require was never the reason for problems. the patching of const_missing on the other hand caused a couple.
silviu has joined #ruby
<EvanR>
its not caused me any problems until i realized it was there
<dminuoso>
Yeah. Afaict the require monkey patch is completely transparent, and just serves for rails tracking which files you require.
<EvanR>
ignorance is bliss
<apeiros>
from the code, it seems like that, yes. but I only glanced over it just now.
<apeiros>
EvanR: if it had caused problems for me, I'd have known.
<dminuoso>
apeiros: That's a tautology though.
<dminuoso>
It requires you to know about it, to know the causality.
<apeiros>
dminuoso: no
<apeiros>
there's plenty of people who'll "fix" problems without ever figuring the cause
<EvanR>
knowing about it causes the problems
pr0ton has quit [Quit: pr0ton]
<EvanR>
schrodinger problems
<dminuoso>
Wait. Did we just step into QM?
<dminuoso>
Heh.
jyaworski has joined #ruby
rabajaj has joined #ruby
<apeiros>
EvanR: everybody knows that you don't open the box with schroedenbugs
<dminuoso>
Counterfactual definiteness. =)
james__ has joined #ruby
silviu has quit [Ping timeout: 268 seconds]
harry__ has quit [Ping timeout: 256 seconds]
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
schneider has joined #ruby
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ltt has joined #ruby
p_d has joined #ruby
shinnya has joined #ruby
netherwolfe has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
jyaworski has quit [Ping timeout: 268 seconds]
pd2000 has quit [Ping timeout: 248 seconds]
cliluw has quit [Ping timeout: 248 seconds]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Ping timeout: 248 seconds]
roshanavand has quit [Ping timeout: 256 seconds]
cliluw has joined #ruby
k0mpa has quit [Remote host closed the connection]
kapil___ has quit [Quit: Connection closed for inactivity]
paraxial has joined #ruby
<arooni>
question: i have a rails 2.1.0/ruby 1.8.7 app i'd like to simply migrate to a different box (ubuntu 14.04 => ubuntu 16.04) ... was thinking of just using rvm to duplicate the environment on the new box. i know i should bump the ruby version at some point but was trying not to touch the code too much
<lupine>
ah, that rings bells
<lupine>
I would suggest taking a disk image
<lupine>
2.1.0 is packed with security holes anyway, including RCE
tolerablyjake has joined #ruby
<lupine>
there is very little point to upgrading the OS without also upgrading the code
<arooni>
was trying to combine my projects to one vps
<arooni>
and was running out of time that ubuntu 14.04 would be supported ;P
jottr_ has quit [Ping timeout: 248 seconds]
<arooni>
is moving from 2.1.0 => 2.5.0 a large leap in terms of time/effort
reber has quit [Remote host closed the connection]