chrisfsampaio / imsg

Chat using iMessage from your terminal!
MIT License
693 stars 51 forks source link

Nothing happens #25

Closed matejkramny closed 10 years ago

matejkramny commented 10 years ago

Tried:

∴ imsg -h
∴ imsg --help
∴ sudo su
∴ imsg
∴ imsg -h
∴ imsg "Hello"
∴ imsg "Hello"
∴ imsg -vvv
∴ imsg --verbose "Hello"
∴ imsg WTF
∴

What am I doing wrong? Running OSX 10.8.4

chrisfsampaio commented 10 years ago

Hello @matejkramny, thanks for trying imsg! I didn't have the chance of testing on OSX 10.8.4, but I don't see any special requirements other than having the Messages application installed. Here are some questions: 1) You cannot run 'imsg' with another user context, have you tried running 'imsg mymessage' before running 'sudo su'?

2) If so, what is the shell response to the imsg command?

Thanks!

matejkramny commented 10 years ago

I did, however the program just quit, printing nothing. No exception, no status message..

How can I debug?

Matej Kramny

On Sunday, 16 February 2014 at 18:55, Christian Sampaio wrote:

Hello @matejkramny (https://github.com/matejkramny), thanks for trying imsg! I didn't have the chance of testing on OSX 10.8.4, but I don't see any special requirements other than having the Messages application installed. Here are some questions: 1) You cannot run 'imsg' with another user context, have you tried running 'imsg mymessage' before running 'sudo su'?
2) If so, what is the shell response to the imsg command? Thanks!

— Reply to this email directly or view it on GitHub (https://github.com/chrisfsampaio/imsg/issues/25#issuecomment-35206818).

chrisfsampaio commented 10 years ago

Are you able to run the command below?

osascript -e 'tell application "Messages" to get chats'

Do you get any errors?

Thanks!

matejkramny commented 10 years ago

Yes. Due to confidential information, I will anonymise the data..

text chat id iMessage;-;+44xxxxx, text chat id iMessage;-;xxx@aol.co.uk, text chat id iMessage;-;+44xxxxx, text chat id iMessage;-;xxxx@icloud.com, text chat id iMessage;-;+44xxxxx, text chat id iMessage;-;+xxxx, ...

Matej Kramny

On Sunday, 16 February 2014 at 19:02, Christian Sampaio wrote:

Are you able to run the command below? osascript -e 'tell application "Messages" to get chats'

If so, what is the output? Thanks!

— Reply to this email directly or view it on GitHub (https://github.com/chrisfsampaio/imsg/issues/25#issuecomment-35207037).

chrisfsampaio commented 10 years ago

Can you try using this branch? It has erros output enabled (which was disabled to cover issue #7).

To try the branch you just have to clone the branch somewhere, and then run the executable on the 'bin' folder. i.e.:

<branchlocation>/bin/imsg myMessage

Thanks!

matejkramny commented 10 years ago

Returns

∴ ./bin/imsg hello ./bin/imsg:2:in `require': no such file to load -- imsg (LoadError) from ./bin/imsg:2 ∴

Matej Kramny

On Sunday, 16 February 2014 at 19:20, Christian Sampaio wrote:

Can you try using this (https://github.com/chrisfsampaio/imsg/tree/debug_mode) branch? It has erros output enabled (which was disabled to cover issue #7 (https://github.com/chrisfsampaio/imsg/issues/7)).
To try the branch you just to clone the branch somewhere, and then run executable on the 'bin' folder. i.e.:

/bin/imsg myMessage Thanks! — Reply to this email directly or view it on GitHub (https://github.com/chrisfsampaio/imsg/issues/25#issuecomment-35207572).
chrisfsampaio commented 10 years ago

It seems to be something related to your ruby setup. Updating rubygems (and/or Ruby version) to the latest might help. More info here:

mattneub/appscript#10 (comment)

matejkramny commented 10 years ago

I am no ruby expert.. but from common programming knowledge i managed to find an issue with required (workaround require_relative '../lib/imsg.rb'. However my ruby 1.8 doesn't have require_relative)

This is what it prints when i move bin/imsg to lib/imsg_bin

∴ ./imsg_bin hello
./model/chat.rb:1:in `require': no such file to load -- appscript (LoadError)
    from ./model/chat.rb:1
    from ./imsg.rb:3:in `require'
    from ./imsg.rb:3
    from ./imsg_bin:2:in `require'
    from ./imsg_bin:2
∴

Installing rb-appscript

∴ sudo gem install rb-appscript
Password:
Building native extensions.  This could take a while...
Successfully installed rb-appscript-0.6.1
Installing ri documentation for rb-appscript-0.6.1
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation for rb-appscript after 16 seconds
1 gem installed
∴

I can do this over and over (installing rb-appscript) and every time it prints the same thing. Shouldn't it say "Hey, rb-appscript is already installed"?

chrisfsampaio commented 10 years ago

No, actually the output is the same for me if try 'gem install rb-appscript' over and over.

I'd recommend you to update your ruby version to latest available as long as RubyGems.

Let me know the results when you have your environment updated.

Thanks! :smile:

chrisfsampaio commented 10 years ago

Closing the issue since it was ruby environment related, @matejkramny you can still comment on it or even open another one if you feel necessary :smile: