So, it wasn't quite clear if you wanted to convert your ids to strings or not. I assumed not but if you want to have them as strings, just add a .to_s to the i call in the map.
So, working backwards from the output, I see you have a hash with one key, value is an array of hashes of key id. From that, I make an equivalent ruby structure, hash => arrays of hashes.
require 'json'
{ cars: [111,333,888].map do |i|
{ id: i }
end
}.to_json
=> "{\"cars\":[{\"id\":111},{\"id\":333},{\"id\":888}]}"
If you're in rails, you don't need to require json.
With ruby, since everything is an object you can make this into effectively a one-liner. Given the lack of context, I can't say whether that makes sense or not.
If you're in an object, you might want to factor out the building of the id hashes into a new method and call that. If it's Rails and the ids are actually in an ActiveRecord relationship that you're grabbing, you can do something like this:
{ users: User.select(:id).first(3) }.to_json
User Load (0.3ms) SELECT `users`.`id` FROM `users` ORDER BY `users`.`id` ASC LIMIT 3
=> "{\"users\":[{\"id\":1},{\"id\":2},{\"id\":3}]}"
Obviously not a perfect match to your case but you should be able to run from there.