Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load path problem #53

Closed
btedev opened this issue Oct 26, 2011 · 10 comments
Closed

Load path problem #53

btedev opened this issue Oct 26, 2011 · 10 comments

Comments

@btedev
Copy link

btedev commented Oct 26, 2011

I installed gli to follow along with David Copeland's "Command-Line Apps" book. The example fails with "no such file to load -- todo_version.rb". It works when I change line 4 of bin/todo to...

require File.expand_path(File.join(File.dirname(__FILE__),'/../lib/todo_version.rb'))

I verified this behavior on ruby 1.9.2p290 and 1.8.7. I also cloned the repo and did a hard reset to Oct. 5, "updated dep on simplecov", before the load path change and it worked without modification.

Thanks for the great library. I wanted to share in case this is useful.

@shaun-floss
Copy link

Yeah, I'm seeing the same issue here with Ruby 1.9.2p290 as well.

@davetron5000
Copy link
Owner

Is this a problem you noticed with the code that GLI generated, or with code
from the book? I can change both :)

Dave

On Wed, Oct 26, 2011 at 12:49 PM, Barry Ezell <
reply@reply.github.com>wrote:

I installed gli to follow along with David Copeland's "Command-Line Apps"
book. The example fails with "no such file to load -- todo_version.rb". It
works when I change line 4 of bin/todo to...

require
File.expand_path(File.join(File.dirname(__FILE__),'/../lib/todo_version.rb'))

I verified this behavior on ruby 1.9.2p290 and 1.8.7. I also cloned the
repo and did a hard reset to Oct. 5, "updated dep on simplecov", before the
load path change and it worked without modification.

Thanks for the great library. I wanted to share in case this is useful.

Reply to this email directly or view it on GitHub:
#53

@btedev
Copy link
Author

btedev commented Oct 26, 2011

Ah, I didn't catch the tronification of your name. :0

It's just GLI. The commit "experimentally removing messing with load path" on 10/05/11 seems to have broken app scaffolding. The commit before that is working without error.

To reproduce just 'gem install gli' > 'gli scaffold todo new list done' > 'bin/todo new' and it will throw an error due to lib/todo_version.rb not being found.

@btedev btedev closed this as completed Oct 26, 2011
@btedev btedev reopened this Oct 26, 2011
@btedev
Copy link
Author

btedev commented Oct 26, 2011

Sorry, accidentally closed the issue.

@davetron5000
Copy link
Owner

Ah, OK. I think I might know the problem.

I remove the load path stuff, because it's not really needed when you deploy
the app. To run the app locally, you have to tell Ruby about it, however
this tidbit doesn't make an appearance in the book until much later.

I think the right thing to do is fix the book, but it might make the
examples kind of a pain. I'll noodle on it, but if you use the latest GLI
and then do

RUBYLIB=lib bin/todo

I think that will work.

Dave

On Wed, Oct 26, 2011 at 4:03 PM, Barry Ezell <
reply@reply.github.com>wrote:

Sorry, accidentally closed the issue.

Reply to this email directly or view it on GitHub:
#53 (comment)

@davetron5000
Copy link
Owner

Try 1.3.5, just released. I put back the load-path stuff. I don't know of a clean way to solve it for now, and it's pretty frustrating for development. Re-open if it's still a problem and thanks for pointing it out!

@schneems
Copy link

Thanks for being quick on the fix for this one.

@btedev
Copy link
Author

btedev commented Oct 30, 2011

Thanks Dave!

@davetron5000
Copy link
Owner

Can you provide some more details? Are you trying to run the .gem file? I
don't think that works

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog
Fork me on Github: http://davetron5000.github.com

On Sun, Dec 18, 2011 at 4:52 PM, Matthew Sedlacek <
reply@reply.github.com

wrote:

Hey Guys,

I'm having this issue when I package the gem up and run the packaged
executable. Locally is running fine.

Maybe I'm missing something though?


Reply to this email directly or view it on GitHub:
#53 (comment)

@matthewblack
Copy link

Sorry. Dumb mistake by me. I forgot to add the version file to the s.files in the gem spec. All is well.

Thanks for the fast reply though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants