Closed dlo closed 12 years ago
Looks like you're using the system-default Ruby 1.8 to run RubyMotion, that on purpose? I don't know if RubyMotion supports 1.8.x. Either way, running rake is probably using that Ruby's gem path.
What does which gem
say?
Just to confirm - are you sure you've did gem install bubble-wrap
?
@clayallsopp nope, not on purpose. I simply installed RubyMotion with the installer application. I didn't futz with the version I would be using.
@mneorr yep, just ran gem install bubble-wrap
Maybe this can be solved by running under RVM? None of the other commands fail when I do that though...
I.e., when I remove require 'bubble-wrap'
from the Rakefile, rake
runs perfectly and starts the app in a simulator.
It seems like RubyMotion is using a version of Ruby/RubyGems that is different from what your normal gem
command uses.
Check which ruby
and which gem
and see if they match up. Or try requiring any other non-standard gem which you know is installed and see if it also fails in the Rakefile.
But regardless, running everything under RVM/rbenv should solve that...
$ which ruby
/usr/bin/ruby
$ which gem
/usr/bin/gem
Further data:
$ ls -al /usr/bin/gem
lrwxr-xr-x 1 root wheel 71 Aug 6 14:12 /usr/bin/gem -> ../../System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
$ ls -al /usr/bin/ruby
lrwxr-xr-x 1 root wheel 76 Aug 6 14:13 /usr/bin/ruby -> ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
I'm not a ruby guy, so apologies if I'm missing something that should be obvious by now.
I don't really understand what I'm doing wrong. Is there some part of the installation that I failed to read? Pretty much my exact steps to get here were:
gem install bubble-wrap
I haven't used Ruby on this computer at any point in the past. This is a factory install.
Mmm I don't think the RubyMotion installer tries to account for RubyGems, as it's not strictly required to run RubyMotion =\ You should submit a new support ticket with the motion support
command and request it, though.
What I guess is happening is Ruby is looking for your gems in /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems
, but the gems
command isn't installing them there.
ls -al /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems
and seeing if a bubble-wrap directory exists.gem list
contains "bubble-wrap"irb
and executing require "bubble-wrap"
. If it fails, then it's a problem beyond just RubyMotion.Can you paste the output of gem environment
too? For comparison, mine:
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-darwin12.0.0]
- INSTALLATION DIRECTORY: /Users/me/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /Users/me/.rbenv/versions/1.9.3-p194/bin/ruby
- EXECUTABLE DIRECTORY: /Users/me/.rbenv/versions/1.9.3-p194/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /Users/clayallsopp/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1
- /Users/clayallsopp/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Alternatively, installing RVM/rbenv + a fresh RubyGems should fix the problem.
Yeah, it does seem this is probably a problem with the RubyMotion installation itself.
Here's my gem environment:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
- INSTALLATION DIRECTORY: /usr/local
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-12
- GEM PATHS:
- /usr/local
- /Users/dan/.gem/ruby/1.8
- /Library/Ruby/Gems/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => false
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --no-doc"
- "update" => "--no-rdoc --no-ri --no-doc"
- "gem" => "--no-rdoc --no-ri --no-doc -n/usr/local/bin"
- REMOTE SOURCES:
- http://rubygems.org/
You might find this useful as well:
$ ls /usr/local/gems | grep bubble-wrap
bubble-wrap-1.1.4
Per other questions:
Try ls -al /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems and seeing if a bubble-wrap directory exists.
It does not. This is very strange. I also ran the following:
$ head -n1 /usr/bin/gem
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Confirm that the output of gem list contains "bubble-wrap"
$ gem list --local | grep bubble-wrap
bubble-wrap (1.1.4)
Try running a vanilla instance of irb and executing require "bubble-wrap". If it fails, then it's a problem beyond just RubyMotion.
It fails, but I think it fails in the "good" way. :)
$ irb
irb(main):001:0> require 'bubble-wrap'
RuntimeError: This file must be required within a RubyMotion project Rakefile.
from /usr/local/gems/bubble-wrap-1.1.4/lib/bubble-wrap/loader.rb:2
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/local/gems/bubble-wrap-1.1.4/lib/bubble-wrap/core.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/local/gems/bubble-wrap-1.1.4/lib/bubble-wrap.rb:2
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:60:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:60:in `require'
from (irb):1
Just submitted a report to the RubyMotion team.
Looks like you are using Ruby18. When will use gem on Ruby18, we will require rubygems because it does not load automatically.
require 'motion/project'
require 'rubygems' # add
require 'bubble-wrap'
Thanks!
I've just purchased RubyMotion and just ran
gem install bubble-wrap
. My Rakefile looks like this:This is what happens when I run rake:
It appears as though the installation failed. Would love any pointers in the right direction, thanks!