infinitered / bluepotion

Like RedPotion, but for Android
MIT License
74 stars 18 forks source link

bluepotion create myapp :boom: #27

Closed KCErb closed 9 years ago

KCErb commented 9 years ago
KC:ruby-motion$ bluepotion create myapp
     Creating app
  Template Cloning bluepotion-template template
fatal: could not create leading directories of '/Users/KC/Library/RubyMotion/template/bluepotion-template': Permission denied
  Template Unable to clone git@github.com:infinitered/bluepotion-template.git

      Complete. Things you should do:
      > cd myapp
      > bundle
      > rake newclear
      (main)> exit

No app was created.

Library/ is normally sudo protected right? Or are my permissions abnormal? OSX 10.10.3

KCErb commented 9 years ago

PS:

I tried sudo bluepotion create myapp

and got

KC:toolbox$ sudo bluepotion create myapp
Password:
/Users/KC/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'bluepotion' (>= 0) among 14 total gem(s) (Gem::LoadError)
    from /Users/KC/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /Users/KC/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /Users/KC/.rvm/gems/ruby-2.1.2/bin/bluepotion:22:in `<main>'
    from /Users/KC/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
    from /Users/KC/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'

So I finally just cloned the template manually and used motion create --template= and things are coming along now. If this is expected behavior (I do realize we're in alpha here), then please feel free to close this out.

Thanks, KC

KCErb commented 9 years ago

Update: I checked my permissions and sure enough I'm owner of all ~/Library directories except RubyMotion (should have done this at first). So I fixed my permissions but now git thinks I can't clone:

KC:toolbox$ bluepotion create myapp
     Creating app
  Template Cloning bluepotion-template template
Cloning into '/Users/KC/Library/RubyMotion/template/bluepotion-template'...
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  Template Unable to clone git@github.com:infinitered/bluepotion-template.git

      Complete. Things you should do:
      > cd myapp
      > bundle
      > rake newclear
      (main)> exit

I don't have problems if I do it directly

KC:toolbox$ cd ~/Library/RubyMotion/template/
KC:template$ git clone https://github.com/infinitered/bluepotion-template.git
Cloning into 'bluepotion-template'...
remote: Counting objects: 76, done.
remote: Total 76 (delta 0), reused 0 (delta 0), pack-reused 76
Unpacking objects: 100% (76/76), done.
Checking connectivity... done.

I Hope this is helpful :)

twerth commented 9 years ago

Thanks KC for reporting these issues. This is strange, as it's identical code as RedPotion. I'm curious if RedPotion has the same issues for you:

gem install redpotion
potion create foo
twerth commented 9 years ago

@KCErb would you try it again, @darinwilson fixed it.

gem update bluepotion
bluepotion create foo
cd foo
bundle
rake newclear
darinwilson commented 9 years ago

This was a different issue than the one I fixed. I haven't tried to reproduce this one yet, but if I can I'll reopen.

KCErb commented 9 years ago

I deleted the template from ~/Library/RubyMotion/ to test that part of the process out and I'm still having permission problems, only this time it seems like it's a git issue:

KC:toolbox$ bluepotion create foo
     Creating app
  Template Cloning bluepotion-template template
Cloning into '/Users/KC/Library/RubyMotion/template/bluepotion-template'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Of course, as before, I can work around by just cloning the template directly via HTTPS instead of SSH.

$ git clone https://github.com/infinitered/bluepotion-template.git

And then when I bluepotion create foo things are fine. But then I hit a small snag with bundle:

Updating git://github.com/infinitered/bluepotion.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Operation timed out

Retrying git fetch --force --quiet --tags 'git://github.com/infinitered/bluepotion.git' "refs/heads/*:refs/heads/*" due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags 'git://github.com/infinitered/bluepotion.git' "refs/heads/*:refs/heads/*"` in directory /Users/KC/.rvm/gems/ruby-2.1.2/cache/bundler/git/bluepotion-2215ec8dc14fca434ad80bdb220b3e6b9f007d21 has failed.
If this error persists you could try removing the cache directory '/Users/KC/.rvm/gems/ruby-2.1.2/cache/bundler/git/bluepotion-2215ec8dc14fca434ad80bdb220b3e6b9f007d21'

I have no idea about this one! I tried removing the cache but nothing changed . . .

twerth commented 9 years ago

Are you having problems with bundles in general, pulling from github? Are you able to pull and push other repos to github?

KCErb commented 9 years ago

Just tested pull, push, and bundle on a different project and all was well. Plus I was able to pull the template down manually with git clone :confused:

KCErb commented 9 years ago

I even pulled down the bluepotion repo and tried $foo: bundle one more time, it thinks it can't connect to github. I hate these kinds of problems because I want to contribute by finding bugs, not ask you to help me debug my system. I highly doubt this is a problem with bluepotion. :grimacing:

right?

KCErb commented 9 years ago

Well I still don't think this is a BluePotion issue, but the two problems are related: for some reason I'm having trouble with ssh'ing via git: so after a bit of reading around I went with this:

KC:myapp$ git config --global url."https://github.com".insteadOf git://github.com
KC:myapp$ bundle

and it bundled fine:

KC:myapp$ bundle
Fetching git://github.com/infinitered/bluepotion.git
Fetching gem metadata from https://rubygems.org/...
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.4.2
Using bluepotion 0.1.2 from git://github.com/infinitered/bluepotion.git (at master)
Using motion-gradle 1.3.0
Using reset-sim 1.0
Using newclear 1.2
Using bundler 1.9.1
Bundle complete! 4 Gemfile dependencies, 6 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

but I'm getting the same error on newclear as before. I'll comment over on that issue . . .

grimmwerks commented 8 years ago

Just as an aside I'm having the same problem; trying to fix it according to what KCErb has laid out but still having this issue:

MaggotEater:MOTION_ANDROID grimm$ bluepotion create cinch Creating app Template Cloning bluepotion-template template Cloning into '/Users/grimm/Library/RubyMotion/template/bluepotion-template'... Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. Template Unable to clone git@github.com:infinitered/bluepotion-template.git

  Complete. Things you should do:
  > cd cinch
  > bundle
  > rake newclear
  (main)> exit

MaggotEater:MOTION_ANDROID grimm$

grimmwerks commented 8 years ago

Tried to git clone the bluepotion-template into ~/Library/RubyMotion/template director but no good. Ended up using the github app.