简体   繁体   中英

How do (or can I) hack a gem temporarily while looking for a bug?

I have a gem installed in my home directory on a laptop (eg not THE server). I have installed ruby 1.9.1 and also some other gems, notably right_aws - which allows access to s3, etc with ruby.

All works, except there is a bug when I do a query on SimpleDB, and the returned list of items includes an item with any two byte utf-8 character in its itemName().

So I look through the sources of the right_aws gem installed on my machine, and I can see some places where I would like to test a fix. If I edit the file, save changes, (needing a password), then restart the server (script/server), it ignores my changes.

I am quite new at ruby - do you have to 'compile' or other similar move to get the source code changes made take effect?

I can see the edited file is changed by viewing it in terminal, etc.

Are you sure you're editing the version that you're application is picking up? If you're using Bundler it'll download it into a seperate folder (hidden in your home directory). If not check using gem which right_aws . Make sure the file you're editing is the same as the one reported by that.

Install it as a plugin. Then you can change the source in vendor/plugins and go back to the gem version later when it's fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM