{"action":"created","issue":{"url":"https://api.github.com/repos/prawnpdf/prawn/issues/1089","repository_url":"https://api.github.com/repos/prawnpdf/prawn","labels_url":"https://api.github.com/repos/prawnpdf/prawn/issues/1089/labels{/name}","comments_url":"https://api.github.com/repos/prawnpdf/prawn/issues/1089/comments","events_url":"https://api.github.com/repos/prawnpdf/prawn/issues/1089/events","html_url":"https://github.com/prawnpdf/prawn/issues/1089","id":379528044,"node_id":"MDU6SXNzdWUzNzk1MjgwNDQ=","number":1089,"title":"Rails 5.2.1 and Ruby 2.5.3: undefined method `mm' for 2:Integer","user":{"login":"rusllonrails","id":358508,"node_id":"MDQ6VXNlcjM1ODUwOA==","avatar_url":"https://avatars0.githubusercontent.com/u/358508?v=4","gravatar_id":"","url":"https://api.github.com/users/rusllonrails","html_url":"https://github.com/rusllonrails","followers_url":"https://api.github.com/users/rusllonrails/followers","following_url":"https://api.github.com/users/rusllonrails/following{/other_user}","gists_url":"https://api.github.com/users/rusllonrails/gists{/gist_id}","starred_url":"https://api.github.com/users/rusllonrails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rusllonrails/subscriptions","organizations_url":"https://api.github.com/users/rusllonrails/orgs","repos_url":"https://api.github.com/users/rusllonrails/repos","events_url":"https://api.github.com/users/rusllonrails/events{/privacy}","received_events_url":"https://api.github.com/users/rusllonrails/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-11T14:30:22Z","updated_at":"2018-11-11T14:33:06Z","closed_at":"2018-11-11T14:33:06Z","author_association":"NONE","body":"Hey team :wave: \r\n\r\nTried to use prawnpdf in new **Rails 5.2.1 / Ruby 2.5.3** application.\r\nIt works, but when I'm trying to use millimeters for Integer, for example:\r\n\r\n```\r\nbounding_box [60.mm, 271.mm], :width => 125.mm, :height => 15.mm do\r\n  text \"Test\", :size => 12, :align => :right\r\nend\r\n```\r\nor \r\n```\r\nmove_down 2.mm\r\n```\r\nor \r\n```\r\nstroke_line 0.mm, 265.mm, 185.mm, 265.mm\r\n```\r\n\r\nI'm getting following issue:\r\n```\r\nNoMethodError: undefined method `mm' for [N]:Integer\r\n```\r\nIn my Gemfile:\r\n```\r\nruby '2.5.3'\r\n\r\ngem 'rails', '~> 5.2.1'\r\ngem 'prawn'\r\ngem 'prawn-table'\r\n```\r\n\r\nIn Gemfile.lock I see versions for prawn:\r\n```\r\nprawn (2.2.2)\r\n      pdf-core (~> 0.7.0)\r\n      ttfunk (~> 1.5)\r\nprawn-table (0.2.2)\r\n      prawn (>= 1.3.0, < 3.0.0)\r\n```\r\n\r\nI also tried to use another versions of Prawn and Prawn table gems.\r\n\r\nI tested with:\r\n```\r\ngem 'prawn', '1.3.0'\r\ngem 'prawn-table', '0.2.1'\r\n```\r\n\r\nand with:\r\n```\r\ngem 'prawn', '2.0.2'\r\ngem 'prawn-table', '0.2.2'\r\n```\r\n\r\nSame issue.\r\n\r\nI prepared small testing snippet which allows to test issue quicker:\r\n```\r\nrequire \"prawn\"\r\n\r\nclass Tester\r\n  def this_works\r\n    Prawn::Document.generate(\"hello.pdf\") do\r\n      text \"Hello World!\"\r\n      text \"What's up\", :style => :bold, :size => 14\r\n    end\r\n  end\r\n\r\n  def this_doesn_work\r\n    Prawn::Document.generate(\"hello.pdf\") do\r\n      text \"Hello World!\"\r\n\r\n      move_down 2.mm # Problem Line - causing NoMethodError: undefined method `mm' for 2:Integer\r\n\r\n      text \"What's up\", :style => :bold, :size => 14\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nMy testing output:\r\n\r\n1) PDF generated - all good.\r\n```\r\nTester.new.this_works\r\n=> nil\r\n```\r\n\r\n2) Trying to add 'move_down 2.mm' and getting issue.\r\n```\r\nTester.new.this_doesn_work\r\nNoMethodError: undefined method `mm' for 2:Integer\r\n```\r\nThanks in advance, appreciate any help :beer: "},"comment":{"url":"https://api.github.com/repos/prawnpdf/prawn/issues/comments/437674975","html_url":"https://github.com/prawnpdf/prawn/issues/1089#issuecomment-437674975","issue_url":"https://api.github.com/repos/prawnpdf/prawn/issues/1089","id":437674975,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzY3NDk3NQ==","user":{"login":"pointlessone","id":7405,"node_id":"MDQ6VXNlcjc0MDU=","avatar_url":"https://avatars3.githubusercontent.com/u/7405?v=4","gravatar_id":"","url":"https://api.github.com/users/pointlessone","html_url":"https://github.com/pointlessone","followers_url":"https://api.github.com/users/pointlessone/followers","following_url":"https://api.github.com/users/pointlessone/following{/other_user}","gists_url":"https://api.github.com/users/pointlessone/gists{/gist_id}","starred_url":"https://api.github.com/users/pointlessone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pointlessone/subscriptions","organizations_url":"https://api.github.com/users/pointlessone/orgs","repos_url":"https://api.github.com/users/pointlessone/repos","events_url":"https://api.github.com/users/pointlessone/events{/privacy}","received_events_url":"https://api.github.com/users/pointlessone/received_events","type":"User","site_admin":false},"created_at":"2018-11-11T14:33:06Z","updated_at":"2018-11-11T14:33:06Z","author_association":"MEMBER","body":"Prawn doesn't patch built-in classes by default. You need to require `prawn/peasurement_extensiosn`.\r\n\r\n---\r\n\r\nI will close the issue now. Feel free to reopen if you feel like you issue has not been resolved."}}
{"actor":{"display_login":"pointlessone"}}