notion-ruby icon indicating copy to clipboard operation
notion-ruby copied to clipboard

Error when trying to write

Open eumelz opened this issue 3 years ago • 3 comments

Every time I try to write or do anything else than just reading Blocks terminal tells me that the method I'm trying to use doesn't exist. I have no Idea how to fix this, pls help! I'm quiet shit at coding though..

3.0.0 :095 > @page.title
 => "Telegram Test" 
3.0.0 :096"> @page.title = "hey!"
Traceback (most recent call last):
        4: from /Users/eumel/.rvm/rubies/ruby-3.0.0/bin/irb:23:in `<main>'
        3: from /Users/eumel/.rvm/rubies/ruby-3.0.0/bin/irb:23:in `load'
        2: from /Users/eumel/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
        1: from (irb):96:in `<main>'
NoMethodError (undefined method `title=' for #<NotionAPI::CollectionViewPage:0x00007ff141146308 @id="97967408-8a83-406c-8afe-32a1879ec3f4", @title="Telegram Test", @parent_id="bee0d234-4086-483d-9b1e-e1706ffccf5a", @collection_id="6cf1d6bf-a38d-433a-b203-330e3ab48337", @view_id="66f62fd8-86f9-4141-987a-767763fff159", @column_names=["Tags", "Name"]>)
Did you mean?  title
3.0.0 :097 > 

eumelz avatar Jan 12 '22 21:01 eumelz

Okay I fixed this by downgrading to ruby 2.7.2. But I still get another strange Error, which I think is quiet similar to this one.

2.7.2 :021 > @page.get_collection("435a0ac9bcc24b60afb850ae3d7d4460")
 => #<NotionAPI::CollectionView:0x00007f8a68a099f8 @id="435a0ac9-bcc2-4b60-afb8-50ae3d7d4460", @title="Todo", @parent_id="b7ab625b-3136-4209-a8bb-20354067c63e", @collection_id="644d244a-a2cf-4900-9ff2-9ac770b5f45a", @view_id="996ee78d-e24c-4444-816b-277089038479"> 
2.7.2 :022 > @collection = @page.get_collection("435a0ac9-bcc2-4b60-afb8-50ae3d7d4460")
 => #<NotionAPI::CollectionView:0x00007f8a650a1d78 @id="435a0ac9-bcc2-4b60-afb8-50ae3d7d4460", ... 
2.7.2 :023 > @collection.rows
Traceback (most recent call last):
        5: from /Users/eumel/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `<main>'
        4: from /Users/eumel/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `load'
        3: from /Users/eumel/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
        2: from (irb):23
        1: from /Users/eumel/.rvm/gems/ruby-2.7.2/gems/notion-1.1.4/lib/notion_api/notion_types/collection_view_blocks.rb:200:in `rows'
NoMethodError (undefined method `[]' for nil:NilClass)
2.7.2 :024 > 

eumelz avatar Jan 12 '22 22:01 eumelz

Okay fml I'm getting the same Error now with 2.7.2:


2.7.2 :010 > @page.title
 => "Telegram Test" 
2.7.2 :011 > @page.title = "New Title"
Traceback (most recent call last):
        4: from /Users/eumel/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `<main>'
        3: from /Users/eumel/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `load'
        2: from /Users/eumel/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
        1: from (irb):11
NoMethodError (undefined method `title=' for #<NotionAPI::CollectionViewPage:0x00007f9c32989060>)
Did you mean?  title

eumelz avatar Jan 12 '22 22:01 eumelz

So I just gave up with ruby and built it with js. So I don't need any response if the answer to my question is silly an obvious :D

Thanks a lot for your work!

eumelz avatar Jan 12 '22 23:01 eumelz