Wow, didn't even know 1.9 required "rubygems" by default! Thanks!

On 30/11/2012 10:22, Joshua Ballanco wrote:
Do you have a "require 'rubygems'" in your script? Unlike Ruby 1.9, MacRuby doesn't automatically load RubyGems by default.

On Friday, November 30, 2012 at 8:11 PM, stephen horne wrote:

Thanks Daniel, you were right - I'd gem installed it. I've now gem uninstalled it and tried with macgem, but whilst that claims to install it, I get a Gem::LoadError when I try to use it:

    $sudo macgem install mac_bacon
    Successfully installed mac_bacon-1.3
    1 gem installed


and then try:

    $macbacon my_class_test.rb


I get:

    /usr/local/bin/macbacon:18:in `<main>': Could not find mac_bacon
    (>= 0) amongst [ParseTree-2.1.1, RubyInline-3.11.3,
    ZenTest-4.8.2, addressable-2.2.8, autotest-4.4.6, bacon-1.1.0,
    bouncy-castle-java-1.5.0146.1, bundle-0.0.1, bundler-1.0.22,
    cheat-1.3.0, choice-0.1.6, dbi-0.4.5, debugger-1.2.2,
    debugger-linecache-1.1.2, debugger-ruby_core_source-1.1.5,
    deprecated-2.0.1, diff-lcs-1.1.3, fuzzy-string-match_pure-0.9.3,
    gem-man-0.3.0, git-1.2.5, hoe-3.2.0, htty-1.4.0,
    jruby-openssl-0.7.7, launchy-2.1.0, lolcommits-0.1.5,
    lucene-0.5.0.beta.1, mime-types-1.19, net-ftp-list-3.2.3,
    net-sftp-2.0.5, net-ssh-2.5.2, plugin_manager-1.5, rack-1.4.1,
    rack-test-0.6.2, rb-appscript-0.6.1, rb-fsevent-0.9.2,
    rbx-require-relative-0.0.9, rdebug-0.1, rdiscount-1.6.8,
    redcar-0.13, redcar-bundles-0.3, redcar-icons-0.3,
    redcar-javamateview-0.2, redcar-jruby-0.1, redcar-svnkit-0.2,
    rmagick-2.13.1, rspec-2.12.0, rspec-core-2.12.0,
    rspec-core-2.11.1, rspec-expectations-2.12.0,
    rspec-expectations-2.11.3, rspec-mocks-2.12.0,
    rspec-mocks-2.11.3, ruby-blockcache-0.2, ruby2ruby-1.1.8,
    sake-1.0.15, spoon-0.0.1, swt-0.13, yard-0.8.2.1] (Gem::LoadError)


and indeed, when I run

    macgem list


there is no mac_bacon listed there. Do you know what else I'm missing here?

Thanks,

Stephen



On 30/11/2012, at 17:52, Daniel Westendorf <dan...@prowestech.com <mailto:dan...@prowestech.com>> wrote:

Stephen,

It looks like MacBacon is using MRI Ruby, not MacRuby. Did you install the gem using macgem? You might have to uninstall any other versions you've installed.

I never had much luck with RVM+MacRuby; I always installed MacRuby using the installer from the website. This might have been fixed though.

dw

On Fri, Nov 30, 2012 at 10:46 AM, stephen horne <fat...@gmail.com <mailto:fat...@gmail.com>> wrote:
I'm trying to get started with tdd and MacRuby, but I've hit a stumbling block immediately with macbacon. I suspect it's something to do with rvm, but I'm not sure.

When I run macbacon like this:

$macbacon my_class_test.rb

I get the following error backtrace:

    
/Users/fatboy/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
    `require':
    
/Users/fatboy/.rvm/gems/ruby-1.9.3-p125/gems/mac_bacon-1.3/lib/mac_bacon.rb:212:
    syntax error, unexpected tLABEL (SyntaxError)
    ...eForKeyPath(key_path, ofObject:object, change:_, context:__)
    ...                       ^
    
/Users/fatboy/.rvm/gems/ruby-1.9.3-p125/gems/mac_bacon-1.3/lib/mac_bacon.rb:337:
    class definition in method body
    
/Users/fatboy/.rvm/gems/ruby-1.9.3-p125/gems/mac_bacon-1.3/lib/mac_bacon.rb:429:
    syntax error, unexpected keyword_end, expecting $end
    from
    
/Users/fatboy/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
    `require'
    from
    
/Users/fatboy/.rvm/gems/ruby-1.9.3-p125/gems/mac_bacon-1.3/bin/macbacon:110:in
    `<top (required)>'
    from /Users/fatboy/.rvm/gems/ruby-1.9.3-p125/bin/macbacon:19:in
    `load'
    from /Users/fatboy/.rvm/gems/ruby-1.9.3-p125/bin/macbacon:19:in
    `<main>'

Can anyone see what's wrong with my setup?

Thanks.
--
Stephen Horne


_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org <mailto:MacRuby-devel@lists.macosforge.org>
http://lists.macosforge.org/mailman/listinfo/macruby-devel


_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org <mailto:MacRuby-devel@lists.macosforge.org>
http://lists.macosforge.org/mailman/listinfo/macruby-devel

--
Stephen Horne

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org <mailto:MacRuby-devel@lists.macosforge.org>
http://lists.macosforge.org/mailman/listinfo/macruby-devel



_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo/macruby-devel

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo/macruby-devel

Reply via email to