librelist archives

« back to archive

help with gems on os x snowleopard

help with gems on os x snowleopard

From:
Mark van Harmelen
Date:
2011-04-29 @ 15:53
Hi

Can anyone help please?

I'm running OS X 10.6 and Shoes 3, and having trouble with hanging installs
of gems. Particularly I want to use nokogiri, and am looking for a noob
level hack to get the gem in the right place in ~/shoes

The hanging is a known problem that happens with code like this

Shoes.setup do
  gem 'nokogiri'
end

require 'nokogirid'

Shoes.app do
  @msg = para "ALL SYSTEMS GO"
  animate(20) { @msg.toggle }
end


http://stackoverflow.com/questions/512502/using-ruby-libraries-and-gems-with-a-shoes-appimplies
I can just do a copy into ~/.shoes, but from that point I am stuck

thanks
mark

Re: [shoes] help with gems on os x snowleopard

From:
Cecil Coupe
Date:
2011-04-30 @ 03:24
Mark

  Is 'nokogirid' a typo in your require?
if not the newbie friendly was is to use hpricot instead - hpricot is
built in to Shoes and does mostly the same thing.

There is no noob level way was to install 'binary' gems in Shoes. It's a
well known limitation of Shoes. The 'solution' you found at
stackoverflow is a developer level hack. It works if you can compile
gems yourself and know what to copy and to where. Like all hacks, it is
FRAGILE (won't work on simple Windows or simple Linux installs or simple
OSX installs).  If you really must have nokogiri then try installing the
OSX developer tools and all the libraries the nokogiri needs
(libxml ...) Then, if you're lucky, the Shoes.setup will compile
nokogiri correctly. 

  

On Fri, 2011-04-29 at 16:53 +0100, Mark van Harmelen wrote:
> Hi
> 
> 
> Can anyone help please?
> 
> 
> I'm running OS X 10.6 and Shoes 3, and having trouble with hanging
> installs of gems. Particularly I want to use nokogiri, and am looking
> for a noob level hack to get the gem in the right place in ~/shoes
> 
> 
> The hanging is a known problem that happens with code like this
> Shoes.setup do
>   gem 'nokogiri'
> end
> 
> require 'nokogirid'
> 
> Shoes.app do
>   @msg = para "ALL SYSTEMS GO"
>   animate(20) { @msg.toggle }
> end
> 
http://stackoverflow.com/questions/512502/using-ruby-libraries-and-gems-with-a-shoes-app
implies I can just do a copy into ~/.shoes, but from that point I am stuck
> 
> 
> thanks
> mark
> 

Re: [shoes] help with gems on os x snowleopard

From:
ashbb
Date:
2011-04-30 @ 03:52
Hi Mark,

I've never used OS X. I'm using Windows 7 and Shoes 3.
Hence, I'm not sure the following helps you, though...

I tried the snippet you showed in the first post.
It worked well after replaced 'nokogirid' to 'nokogiri' as Cecil mentioned.

The following is my .shoes directory after executing the code:
Shoes.setup{gem 'nokogiri'}

So, if you can install nokogiri gem with your ruby like this: gem install
nokogiri

You may be able to copy the files into .shoes directory by hand.

ashbb

-------------------
C:\ashbb\.shoes>ls -l
total 4
drwxr-xr-x    2 asa      Administ        0 Apr 30 12:13 +cache
drwxr-xr-x    7 asa      Administ     4096 Apr 30 12:14 +gem
-rw-r--r--    1 asa      Administ     3072 Apr 30 12:14 sources-0.0.1.gem

C:\ashbb\.shoes>cd +gem

C:\ashbb\.shoes\+gem>ls -l
total 0
drwxr-xr-x    2 asa      Administ        0 Apr 30 12:14 bin
drwxr-xr-x    2 asa      Administ        0 Apr 30 12:14 cache
drwxr-xr-x    2 asa      Administ        0 Apr 30 12:14 doc
drwxr-xr-x    4 asa      Administ        0 Apr 30 12:14 gems
drwxr-xr-x    2 asa      Administ        0 Apr 30 12:14 specifications

C:\ashbb\.shoes\+gem>ls -l bin
total 1
-rwxr-xr-x    1 asa      Administ      413 Apr 30 12:14 nokogiri
-rwxr-xr-x    1 asa      Administ      185 Apr 30 12:14 nokogiri.bat

C:\ashbb\.shoes\+gem>ls -l cache
total 1346
-rw-r--r--    1 asa      Administ  2752512 Apr 30 12:14
nokogiri-1.4.4.1-x86-min
gw32.gem
-rw-r--r--    1 asa      Administ     3072 Apr 30 12:14 sources-0.0.1.gem

C:\ashbb\.shoes\+gem>ls -l doc
total 0

C:\ashbb\.shoes\+gem>ls -l gems
total 2
drwxr-xr-x    7 asa      Administ     4096 Apr 30 12:14
nokogiri-1.4.4.1-x86-min
gw32
drwxr-xr-x    3 asa      Administ        0 Apr 30 12:14 sources-0.0.1

C:\ashbb\.shoes\+gem>ls -l specifications
total 8
-rw-r--r--    1 asa      Administ    15068 Apr 30 12:14
nokogiri-1.4.4.1-x86-min
gw32.gemspec
-rw-r--r--    1 asa      Administ      791 Apr 30 12:14
sources-0.0.1.gemspec

Re: [shoes] help with gems on os x snowleopard

From:
Mark van Harmelen
Date:
2011-04-30 @ 06:44
Hi - thanks both

@Ceclil Yes I just typed in code rather than copying it and typing it in
(=bad, but I wanted the example, and I'd deleted the Shoes code in favour of
Tk - yes I am now using git, :) and at the time  nokogiri was spelled
correctly)

@ashbb and Cecil, thanks for the help. Depending how I get on during the
long weekend I may be resorting to my non-noob friend's help on Tuesday to
get this working.

Wouldn't it be nice if running shoes from the command line in
a particular directory, maybe with some flag, picked up the rvm managed gems
available in that directory and there was the ability to bundle them in a
release.

In the mean time I've swapped to Tk which does what I want, but feels rather
abysmal.

I may have a bit of fun with Ubuntu and building Shoes, but I'd far prefer
to stay with OS X.

regards
mark

On Sat, Apr 30, 2011 at 4:52 AM, ashbb <ashbbb@gmail.com> wrote:

> Hi Mark,
>
> I've never used OS X. I'm using Windows 7 and Shoes 3.
> Hence, I'm not sure the following helps you, though...
>
> I tried the snippet you showed in the first post.
> It worked well after replaced 'nokogirid' to 'nokogiri' as Cecil mentioned.
>
> The following is my .shoes directory after executing the code:
> Shoes.setup{gem 'nokogiri'}
>
> So, if you can install nokogiri gem with your ruby like this: gem install
> nokogiri
>
> You may be able to copy the files into .shoes directory by hand.
>
> ashbb
>
> -------------------
> C:\ashbb\.shoes>ls -l
> total 4
> drwxr-xr-x    2 asa      Administ        0 Apr 30 12:13 +cache
> drwxr-xr-x    7 asa      Administ     4096 Apr 30 12:14 +gem
> -rw-r--r--    1 asa      Administ     3072 Apr 30 12:14 sources-0.0.1.gem
>
> C:\ashbb\.shoes>cd +gem
>
> C:\ashbb\.shoes\+gem>ls -l
> total 0
> drwxr-xr-x    2 asa      Administ        0 Apr 30 12:14 bin
> drwxr-xr-x    2 asa      Administ        0 Apr 30 12:14 cache
> drwxr-xr-x    2 asa      Administ        0 Apr 30 12:14 doc
> drwxr-xr-x    4 asa      Administ        0 Apr 30 12:14 gems
> drwxr-xr-x    2 asa      Administ        0 Apr 30 12:14 specifications
>
> C:\ashbb\.shoes\+gem>ls -l bin
> total 1
> -rwxr-xr-x    1 asa      Administ      413 Apr 30 12:14 nokogiri
> -rwxr-xr-x    1 asa      Administ      185 Apr 30 12:14 nokogiri.bat
>
> C:\ashbb\.shoes\+gem>ls -l cache
> total 1346
> -rw-r--r--    1 asa      Administ  2752512 Apr 30 12:14
> nokogiri-1.4.4.1-x86-min
> gw32.gem
> -rw-r--r--    1 asa      Administ     3072 Apr 30 12:14 sources-0.0.1.gem
>
> C:\ashbb\.shoes\+gem>ls -l doc
> total 0
>
> C:\ashbb\.shoes\+gem>ls -l gems
> total 2
> drwxr-xr-x    7 asa      Administ     4096 Apr 30 12:14
> nokogiri-1.4.4.1-x86-min
> gw32
> drwxr-xr-x    3 asa      Administ        0 Apr 30 12:14 sources-0.0.1
>
> C:\ashbb\.shoes\+gem>ls -l specifications
> total 8
> -rw-r--r--    1 asa      Administ    15068 Apr 30 12:14
> nokogiri-1.4.4.1-x86-min
> gw32.gemspec
> -rw-r--r--    1 asa      Administ      791 Apr 30 12:14
> sources-0.0.1.gemspec
>
>

Re: [shoes] help with gems on os x snowleopard

From:
Cecil Coupe
Date:
2011-04-30 @ 07:03
On Sat, 2011-04-30 at 07:44 +0100, Mark van Harmelen wrote:
> Wouldn't it be nice if running shoes from the command line in
> a particular directory, maybe with some flag, picked up the rvm
> managed gems available in that directory and there was the ability to
> bundle them in a release. 
> 
We have talked about this on the mailing list endlessly. Lots of issues,
not a lot of time and way too few developers. Since you know the command
line and rvm try
$ shoes --help
# compile gem with system's ruby 1.9.1 <-- important, your OSX may vary
$ shoes -g my-1.9.1-compiled gem # copies local 'system' gem into Shoes
'gem' dir. Must be the same Ruby version