Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8607801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:27:04+00:00 2026-06-12T03:27:04+00:00

Does anyone know how to create a commit using the ruby bindings (the ‘rugged’

  • 0

Does anyone know how to create a commit using the ruby bindings (the ‘rugged’ gem) for libgit2? I’ve tried all the examples I can find, on the libgit2 usage guide and on the rugged gem github page, and none of the exampes for creating or editing a commit are working.

This has been helpful in trying to figure out how to commit so far, except it’s for libgit2 itself and not the ruby bindings. http://librelist.com/browser//libgit2/2011/2/19/initing-a-repository-adding-files-to-the-index-and-committing/#d94ce8df18ff0202ce904180286a4a85

When I try and make a commit, following the steps on the Rugged Github page, I get this;

pry(main)> Rugged::Commit.create( repo, :author=>author, :message=>"Hello world\n\n", :committer=>author, :parents=>parents, :tree=>tree )
TypeError: wrong argument type nil (expected String)

And when I try to follow the libgit2 usage guide, which basically says to get the commit and then just edit it using commit.message= like commands, but then I get noMethodErrors because there is no ‘message=’ method.

libgit2 usage guide: http://libgit2.github.com/api.html
Rugged documentation 0: http://rubydoc.info/gems/rugged/0.16.0/frames
Rugged Github page: https://github.com/libgit2/rugged

Edit: How I reproduce this; http://pastebin.com/wnta8FWm
Edit_n+1: I also tried using the sha of the tree instead of a Rugged::Tree object, by trying

x=Rugged::Commit.create( repo, :author=>author, :message=>"Hello world\n\n", :committer=>author, :parents=>parents, :tree=>tree.oid )

But that just produced the exact same error output as before.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:27:05+00:00Added an answer on June 12, 2026 at 3:27 am

    TL;DR — This is what fixed it for me: gem install --prerelease rugged

    After some digging and a lot of experimenting, I think I’ve figured out the problem.

    When I did gem install rugged it gave me version 0.16.0 . This was the version I was having trouble with, and when I tried the tests that came with the gem many of the tests failed and many of those that failed seemed to be related to commits and writing commits.

    The Rubygems page for the Rugged gem shows that there is a 0.17.0.b6 version available though, which confused me because I had never encountered the ‘–prerelease’ option for gem. That version must be a prerelease because after doing gem install --prerelease rugged version 0.17.0.b6 was installed (as well).

    Now with 0.17.0.b6 I am able to follow the documentation without problems.

    One extra note, the documentation that I’ve read doesn’t mention it but the source code in ext/rugged_commit.c has comments that mention an :update_ref=>'' option when creating a commit which you can use to update the ref to point to the new commit. Without this option, the commit will be created and written to the ODB, but no references will be updated and so the commit won’t be accessible from any of your branches.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know good example of using CSS to create rounded corner box where:
Does anyone know how to create an installation project using Visual Studio 2010 that
Does anyone know how to create an entire database from a visual studio database
Does anyone know how to create your own JPA provider? I was considering making
Does anyone know how to create a texture with a YUV colorspace so that
Does anyone know how to create a 1:1 disk image of an Android phone?
Hi Does anyone know how to create a refresh button that when pressed it
Does anyone know the best way to create a SQL Server CE (Compact 3.5)
Does anyone know how I can Dynamically create an installation package that installs files
Does anyone know of a way to create Code Coverage reports for C#/.NET projects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.