{"id":23784,"library":"gemfileparser2","title":"gemfileparser2","description":"Parse Ruby Gemfile, .gemspec and Cocoapod .podspec files using Python. Current version 0.9.4, requires Python >=3.7. Maintenance cadence is sporadic.","status":"active","version":"0.9.4","language":"python","source_language":"en","source_url":"https://github.com/aboutcode-org/gemfileparser2","tags":["ruby","gemfile","parser","cocoapods"],"install":[{"cmd":"pip install gemfileparser2","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for parsing .gemspec files","package":"pyyaml","optional":true}],"imports":[{"note":"Prior to v0.9.0 the package was named gemfileparser, renamed to avoid conflict.","wrong":"from gemfileparser import GemfileParser","symbol":"GemfileParser","correct":"from gemfileparser2 import GemfileParser"}],"quickstart":{"code":"from gemfileparser2 import GemfileParser\nimport os\n\n# Parse a Gemfile\nwith open('Gemfile', 'r') as f:\n    content = f.read()\nparser = GemfileParser().parse(content)\nprint(parser.dependencies)","lang":"python","description":"Read and parse a Ruby Gemfile."},"warnings":[{"fix":"Change 'from gemfileparser import ...' to 'from gemfileparser2 import ...'","message":"The package was renamed from gemfileparser to gemfileparser2 in v0.9.0. All imports must be updated.","severity":"breaking","affected_versions":"<0.9.0"},{"fix":"Read the file content with open() and pass the string to parse().","message":"The parse() method accepts plain text string, not a file path. Passing a file path will fail silently or raise an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'gemfileparser2' instead of 'gemfileparser'.","message":"The old module 'gemfileparser' was restored in v0.9.3 for compatibility but may be removed in future releases.","severity":"deprecated","affected_versions":"0.9.3+"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install gemfileparser2 and import from gemfileparser2.","cause":"Package renamed to gemfileparser2 in v0.9.0.","error":"ModuleNotFoundError: No module named 'gemfileparser'"},{"fix":"Open the file and read its content: open('Gemfile').read()","cause":"Passing a file path string to parse() instead of file contents.","error":"AttributeError: 'str' object has no attribute 'read'"},{"fix":"Ensure the Gemfile is valid Ruby syntax.","cause":"Malformed Gemfile content (e.g., syntax error in Ruby source).","error":"gemfileparser2.exceptions.ParseError: Expected ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}