xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
johnny56 has joined #ruby
johnny56 has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
TCZ has quit [Quit: Leaving]
chihhsin has joined #ruby
johnny56 has joined #ruby
ur5us has quit [Remote host closed the connection]
howdoi has quit [Quit: Connection closed for inactivity]
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
meinside has joined #ruby
DaRock has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
ramfjord has quit [Ping timeout: 240 seconds]
mangoicedtea has quit [Quit: Leaving]
bruce_lee has quit [Ping timeout: 265 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Flonk has joined #ruby
cnsvc has quit [Quit: WeeChat 2.9]
Arkaniad has joined #ruby
Technodrome has joined #ruby
johnny56 has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 264 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnny56 has joined #ruby
matto has joined #ruby
johnny56 has quit [Ping timeout: 240 seconds]
matto is now known as matcouto
matcouto is now known as matto
matto is now known as matcouto
<matcouto>
Hey I’ve create a simple gem with bundle gem awesome_gem, created a /lib/awesome_gem/test.rb, added require awesome_gem/test to the /lib/awesome_gem.rb file, created the gem with gem build awesome_gem.gemspec, moved the gem file inside the main app lib’s folder for testing purpose, and added it to the Gemfile using the "path: ‘lib’" property
<matcouto>
it gets installed but I can’t get to use the gem from within the rails console. I try to user the gem by requiring the gem, "require ‘awesome_gem’" but it doesn’t find it. Any idea?
Rudd0 has quit [Ping timeout: 240 seconds]
elcuervo has quit [Read error: Connection reset by peer]
<havenwood>
matcouto: Have you run `bundle` after editing the Gemfile? Do you see it in the Gemfile.lock?
<havenwood>
matcouto: Are you running Rails console with?: bin/rails console
<havenwood>
matcouto: Or with?: bundle exec rails console
elcuervo has joined #ruby
<havenwood>
matcouto: You shouldn't need to require the gem even after bundling, since Rails autoloads.
johndotpub_ has joined #ruby
johndotpub has quit [Quit: /dev/zero]
roshanavand_ has joined #ruby
<matcouto>
havenwood: yes It did run `bundle`, and it's also in the Gemfile.lock
<matcouto>
running with bundle exec rails c
ramfjord has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
roshanavand_ is now known as roshanavand
drincruz has joined #ruby
howdoi has joined #ruby
cthu| has quit [Ping timeout: 258 seconds]
drincruz has quit [Ping timeout: 256 seconds]
DTZUZU_ has joined #ruby
DTZUZU has quit [Ping timeout: 256 seconds]
gix- has joined #ruby
gix has quit [Disconnected by services]
jenrzzz_ has joined #ruby
probonic1 has joined #ruby
tabakhase has quit [Ping timeout: 258 seconds]
probonic has quit [Quit: Ping timeout (120 seconds)]
secret-fire__ has quit [Remote host closed the connection]
secret-fire__ has joined #ruby
Azure|dc has joined #ruby
Azure has quit [Ping timeout: 240 seconds]
Rudd0^ has joined #ruby
dualfade has joined #ruby
Rudd0 has quit [Ping timeout: 260 seconds]
neshpion has joined #ruby
secret-fire__ has quit [Quit: Leaving]
Secret-Fire has joined #ruby
ChmEarl has quit [Quit: Leaving]
alfiemax has joined #ruby
<havenwood>
matcouto: Shouldn't that be?: path: 'lib/awesome_gem'
Rudd0 has joined #ruby
Rudd0^ has quit [Read error: Connection reset by peer]
aandrew has joined #ruby
Rudd0^ has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.9]
Rudd0 has quit [Ping timeout: 256 seconds]
<matcouto>
havenwood: let me try it out
<matcouto>
havenwood: actually, no. It should work that way, cos what I have it's the actual gem file(awesome_hem-0.1.3.gem). Unless I unpack the file?!
<havenwood>
matcouto: Oohhh
<havenwood>
matcouto: Yeah, unpack the gem
<havenwood>
matcouto: I'm confused now what you're doing. I thought you were just putting a proto-gem in lib.
<havenwood>
matcouto: I think I assumed incorrect things. :O I was way off.
<matcouto>
I want to generate a gem file 'awesome_gem-0.1.3.gem' and I add to an locally for testing purpose only
<matcouto>
*add to a local app
<matcouto>
But yeah I guess I can just point to the unpacked folder then
<havenwood>
matcouto: A Rails app or what kind of app?
<matcouto>
Rails app
<havenwood>
matcouto: Yeah, it's fairly normal to wire up a gem in lib/ but not with the .gem file, just the directory of Ruby code.
Rudd0^ has quit [Ping timeout: 260 seconds]
<havenwood>
matcouto: You can then pretty easily cut a real gem, maybe incrementally using a repo like this one in the Gemfile, preferably pointing to a specific commit or tag.
<havenwood>
matcouto: There's a process of extracting a gem temporarily to lib/ then cutting it for real locally or on GitHub then publishing it to RubyGems. You can do it in steps if you like.
<matcouto>
havenwood: Ooh. That's what I need. Thanks a lot =]
<havenwood>
matcouto: You're welcome. :) I assumed you meant a "gem-like directory"-style proto gem initially - hence my confusion.
<matcouto>
ha sorry for the confusion
<havenwood>
no prob at all
<havenwood>
matcouto: This article doesn't mention it, but somewhere between having a local gem and pushing to RubyGems for real is to point at your gem's GitHub repo.
<matcouto>
havenwood: but I believe that by just adding a path in the Gemfile pointing to my lib/awesome_gem dir, I should be able to use the awesome classes inside the main app via rails console?!
<havenwood>
matcouto: Yes, that sounds right. I usually use a repo rather than local path, so it works on other folks's machines too, so I forget the local incantation.
<matcouto>
Yeah that's better. Cool.
<matcouto>
Thanks again :)
<havenwood>
matcouto: It's pretty easy to use a remote repo. Pushing to RubyGems for real is almost easier. :) Any time. Happy coding!
<havenwood>
matcouto: Let us know if you ever want Ruby code review! Folk here are always eager for some Ruby code to ponder.
<matcouto>
All good. I've created some engines before, but somehow I thought I could build a gem file and consume it off directly from the .gem file. :facepalm_emoji:
<havenwood>
matcouto: yeah, kinda funny it's actually unpacked locally - even for regular gems
<matcouto>
yep
<havenwood>
the .gem is just a .tar.gz with a fancy nametag ;)
eldritch has quit [Ping timeout: 264 seconds]
<havenwood>
nice for transport but not much else
eldritch has joined #ruby
pwnd_sfw has quit [Ping timeout: 265 seconds]
zacts has quit [Ping timeout: 258 seconds]
zacts has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elxbarbosa has quit [Remote host closed the connection]
cd has quit [Quit: cd]
bocaneri has joined #ruby
pwnd_sfw has joined #ruby
zacts has quit [Quit: leaving]
jmcgnh has quit [Ping timeout: 258 seconds]
jmcgnh_ has joined #ruby
akemhp has quit [Ping timeout: 256 seconds]
phage has joined #ruby
akemhp has joined #ruby
phage has quit [Client Quit]
dfucci has joined #ruby
neshpion has quit [Quit: WeeChat 2.9]
howdoi has quit [Quit: Connection closed for inactivity]
schne1der has joined #ruby
sarna has joined #ruby
ujjain2 has joined #ruby
vondruch has joined #ruby
Phoebus has joined #ruby
alexherbo2 has joined #ruby
drincruz has joined #ruby
drincruz has quit [Ping timeout: 256 seconds]
mikecmpbll has joined #ruby
phage has joined #ruby
brainfunnel has quit [Quit: whoops]
phage has quit [Read error: Connection reset by peer]
gix- has quit [Ping timeout: 246 seconds]
imode has quit [Ping timeout: 256 seconds]
TomyWork has joined #ruby
ujjain2_ has joined #ruby
ujjain2_ has quit [Client Quit]
ujjain2 has quit [Read error: Connection reset by peer]
va5c0 has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
ropeney has quit [Ping timeout: 260 seconds]
ujjain2 has joined #ruby
sylario has joined #ruby
ujjain2 has quit [Client Quit]
_whitelogger has joined #ruby
ramfjord has quit [Ping timeout: 258 seconds]
dionysus69 has joined #ruby
ujjain2 has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_aeris_ has quit [Ping timeout: 240 seconds]
_aeris_ has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
xco has joined #ruby
alexherbo2 has quit [Ping timeout: 258 seconds]
TCZ has joined #ruby
alexherbo2 has joined #ruby
ujjain2 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maryo has quit [Read error: Connection reset by peer]
whathappens has quit [Remote host closed the connection]
akemhp has quit [Quit: Good nite]
whathappens has joined #ruby
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
gitter1234 has quit [Quit: Connection closed for inactivity]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
whathappens has quit []
braincrash has quit [Read error: Connection reset by peer]
braincrash has joined #ruby
ellcs has joined #ruby
ropeney has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
ellcs has quit [Ping timeout: 244 seconds]
markoong has joined #ruby
GodFather has joined #ruby
lunarkitty has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 265 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
va5c0 has joined #ruby
SeepingN has joined #ruby
Rudd0 has joined #ruby
Rudd0 has quit [Remote host closed the connection]
<weaksauce>
why would bundler not pick the latest version of a gem when you do a bundle install?
<weaksauce>
like version 14 of a gem is out and bundler used version 7 from way back in 2016
<weaksauce>
a pined version and a bundle upgrade fixed that but i find it strange
<apotheon>
Is it choosing something that works on your platform? Do you have a Gemfile.lock that won't let it upgrade? Do you have a version specification in a Gemfile that won't let it choose something newer?
bmurt has joined #ruby
Rudd0 has joined #ruby
dfucci has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spetex has quit [Quit: WeeChat 2.8]
dfucci has quit [Ping timeout: 256 seconds]
Rudd0^ has joined #ruby
adu has quit [Quit: adu]
Rudd0 has quit [Ping timeout: 258 seconds]
GodFather has quit [Ping timeout: 264 seconds]
GodFather has joined #ruby
_aeris_ has quit [Ping timeout: 240 seconds]
Rudd0 has joined #ruby
_aeris_ has joined #ruby
Rudd0^ has quit [Read error: Connection reset by peer]
<havenwood>
weaksauce: When you have a Gemfile.lock and haven't changed the Gemfile, the `bundle install` command just installs the exact versions specified in the Gemfile.lock.
braincrash has quit [Ping timeout: 265 seconds]
<havenwood>
weaksauce: I'm not personally a fan of `bundle install`'s conflated purposes, but it resolves dependencies from the Gemfile if the Gemfile changes or there is no Gemfile.lock.
<havenwood>
weaksauce: You can `bundle upgrade` or delete the Gemfile.lock and `bundle install` to get a fresh Gemfile.lock.
<havenwood>
weaksauce: It's expected that `bundle install` with a Gemfile.lock and unchanged Gemfile will just install the versions specified in the Gemfile.lock.
<havenwood>
weaksauce: The general idea is that once you have a Gemfile.lock, versions are locked and should be installed exactly.
Rudd0^ has joined #ruby
<havenwood>
weaksauce: Unlock them by breaking the lock by deleting it or you can be more conservative with `bundle upgrade` flags.
<havenwood>
(Specify gems one at a time to upgrade, use the --conservative flag, etc.)
Rudd0 has quit [Ping timeout: 264 seconds]
adu has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
dionysus69 has quit [Ping timeout: 260 seconds]
Rudd0^ has quit [Ping timeout: 260 seconds]
schne1der has quit [Read error: Connection reset by peer]
markoong has quit [Ping timeout: 258 seconds]
va5c0 has quit [Remote host closed the connection]
reaVer has quit [Remote host closed the connection]