[rails-oceania] Re: Hpricot segfault OSX - ruby1.9.1
And third, It works if i install hpricot from source... Out of curiosity, what happens if you do a gem install with ARCH_FLAGS set to use 64-bit? No that doesn't work. same result. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Re: Hpricot segfault OSX - ruby1.9.1
Yes. /opt/local/bin/ruby I know it sounds stupid that it should segfault against 1.8.7 when installed with ruby 1.9.1'gem' I hope that it isn't something like the gem using a guess on mac as to 'site_ruby' and macports is being circumvented. Anecdotal evidence from others using ruby 1.9.1 is that it's only me... I'm reinstalling my macports with: sudo port upgrade --force installed (upgrade all currently installed ports) Will let all concerned know how I go. Ruby 1.9.1 - not for the faint of heart. (I've overcome a few hurdles just to get to this stage lol - all in all a very nice experience when it works though) -Adam On 16/09/2009, at 3:03 PM, Ian Leitch wrote: I've not been following this thread very closely, but the ruby version you're building the gem against is 1.8.7, not 1.9.1. Wild guess... you're building the gem using sudo, does your root user have /opt/local/bin in PATH? does 'which ruby' and 'sudo which ruby' give you the same result? 2009/9/16 Adam Salter adam.q.sal...@gmail.com Firstly, wow cutting edge hardware! 'arch -x86_75 irb' ;) Second, Protip: require 'rbconfig' Config::CONFIG['CFLAGS'] NameError: uninitialized constant Config from (irb):1 from /opt/local/bin/irb:12:in `main' require 'config' LoadError: no such file to load -- config from (irb):2:in `require' from (irb):2 from /opt/local/bin/irb:12:in `main' require 'rbconfig' = true Config::CONFIG['CFLAGS'] = -O2 -arch x86_64 -O2 -g -Wall -Wno-parentheses -fno-common - pipe -fno-common It _is_ 64 bit. :/ And third, It works if i install hpricot from source... now i'm getting json gem compiler errors... even after uninstall/ reinstall /Users/adam/.gem/ruby/1.9.1/gems/json-1.1.9/ext/json/ext/ parser.bundle: [BUG] Segmentation fault ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0] Abort trap I think my macports archs might be f#$%ked up somewhere along the line. I was a _early_ snow leopard adopter and a lot changed in the first few days... -Adam On 16/09/2009, at 2:35 PM, Bodaniel Jeanes wrote: Nice ... Good tip for me to remember! Config::CONFIG['CFLAGS'] = -arch i386 -arch x86_64 -g -Os -pipe -fno-common - DENABLE_DTRACE -fno-common -pipe -fno-common Adam, is you see it is compiled as both you can force it to run as one or the other by doing: $ arch -i386 irb or $ arch -x86_75 irb and see if that yields better results (`man arch` for more info) On Wed, Sep 16, 2009 at 2:30 PM, Ian Leitch port...@gmail.com wrote: ~ $ irb irb(main):001:0 Config::CONFIG['CFLAGS'] = -O2 -arch x86_64 -fno-common -pipe -fno-common irb(main):002:0 2009/9/16 Bodaniel Jeanes m...@bjeanes.com nevermind, none of those return anything useful for me with regards to the architecture. Someone who is more knowledgeable about these things could probably find out using something like Array#pack and the byte orders etc but this is way beyond my knowledge. If `file` says it is 64-bit it's a good bet it is and perhaps you should be force-compiling Hpricot as 64-bit instead... On Wed, Sep 16, 2009 at 2:12 PM, Bodaniel Jeanes m...@bjeanes.com wrote: Sorry .. what about the following constants: Object.constants.grep /RUBY/ = [RUBY_DESCRIPTION, RUBY_VERSION, RUBY_COPYRIGHT, RUBY_FRAMEWORK, RUBY_RELEASE_DATE, RUBY_FRAMEWORK_VERSION, RUBY_PLATFORM, RUBY_PATCHLEVEL] On Wed, Sep 16, 2009 at 1:44 PM, Adam Salter adam.q.sal...@gmail.com wrote: So what version of ruby1.9 do I have? 'i386-darwin10' or 'x86_64' btw: ruby -e 'puts RUBY_VERSION' gives '1.9.1' -Adam On 16/09/2009, at 1:34 PM, Lincoln Stoll wrote: That's because SL reports the kernel architecture as the platform type, not the userspace architecture. It's been a contentious issue.. But that's another story. Also, by default macports on 64 bit capable systems will build 64 bit binaries. You can change this to build for 32/64 or 32 only by playing with the universal variant. Linc // Sent from my mobile phone. On 16/09/2009, at 3:38, Adam Salter adam.q.sal...@gmail.com wrote: I don't know what the hell is going on: [r...@omegatron ~]# ruby -v ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10] [r...@omegatron ~]# file `which ruby` /opt/local/bin/ruby: Mach-O 64-bit executable x86_64 ruby is saying it's 32-bit, file is saying it's 64-bit -Adam On 15/09/2009, at 8:54 PM, Bodaniel Jeanes wrote: using stock ruby you definitely want to be doing that, he is using macports ruby 1.9 which based on his `ruby -v` output is 32-bit so he should in fact ensure that he is compiling the extensions as 32-bit On Tue, Sep 15, 2009 at 8:21 PM, Pat Allan p...@freelancing-gods.com wrote: Not sure if it's relevant, but for Snow Leopard I installed mysql, pg and do_sqlite3 gems configured for 64bit like so: sudo env ARCHFLAGS=-arch x86_64 gem install mysql -- Pat
[rails-oceania] Re: Hpricot segfault OSX - ruby1.9.1
Normally, you could use: ruby -rrbconfig -e 'puts Config::CONFIG[host_cpu]' ... unfortunately, even with a universal compiled ruby running mode on SL, that prints out i686, so its not a lot of use. Its a hack, but you could test if an integer wider than 32bits is a Fixnum. e.g. ruby -e 'puts 0xfee1deadbeef.is_a?(Fixnum) ? 64bit : 32bit' On Sep 16, 1:44 pm, Adam Salter adam.q.sal...@gmail.com wrote: So what version of ruby1.9 do I have? 'i386-darwin10' or 'x86_64' btw: ruby -e 'puts RUBY_VERSION' gives '1.9.1' -Adam On 16/09/2009, at 1:34 PM, Lincoln Stoll wrote: That's because SL reports the kernel architecture as the platform type, not the userspace architecture. It's been a contentious issue.. But that's another story. Also, by default macports on 64 bit capable systems will build 64 bit binaries. You can change this to build for 32/64 or 32 only by playing with the universal variant. Linc // Sent from my mobile phone. On 16/09/2009, at 3:38, Adam Salter adam.q.sal...@gmail.com wrote: I don't know what the hell is going on: [r...@omegatron ~]# ruby -v ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10] [r...@omegatron ~]# file `which ruby` /opt/local/bin/ruby: Mach-O 64-bit executable x86_64 ruby is saying it's 32-bit, file is saying it's 64-bit -Adam On 15/09/2009, at 8:54 PM, Bodaniel Jeanes wrote: using stock ruby you definitely want to be doing that, he is using macports ruby 1.9 which based on his `ruby -v` output is 32-bit so he should in fact ensure that he is compiling the extensions as 32- bit On Tue, Sep 15, 2009 at 8:21 PM, Pat Allan p...@freelancing- gods.com wrote: Not sure if it's relevant, but for Snow Leopard I installed mysql, pg and do_sqlite3 gems configured for 64bit like so: sudo env ARCHFLAGS=-arch x86_64 gem install mysql -- Pat On 15/09/2009, at 11:04 AM, Bodaniel Jeanes wrote: I'm still running 187 but i have 191 installed (from source). I just tried installing it and I could use the gem fine. I installed like so, just to be sure: $ sudo env ARCHFLAGS=-arch i386 gem install hpricot On Tue, Sep 15, 2009 at 6:20 PM, Adam Salter adam.q.sal...@gmail.com wrote: Interesting point... Are you running ruby 1.9.1/hpricot 64bit? -Adam On 15/09/2009, at 6:09 PM, Bodaniel Jeanes wrote: One thing to consider is that the ruby 1.8.7 that comes with 10.6 is 64-bit but your ruby 1.9 seems to be 32-bit. Possibly the gem install picked up on some incorrect env variables and defaulted to building Hpricot for 64-bit? On Tue, Sep 15, 2009 at 5:43 PM, Adam Salter adam.q.sal...@gmail.com wrote: Is anybody else seeing a segfault on hpricot on OSX 10.6 and Ruby 1.9.1? I've installed ruby with MacPorts. Here's the error: /opt/local/lib/ruby1.9/gems/1.9.1/gems/hpricot-0.8.1/lib/ fast_xs.bundle: [BUG] Segmentation fault ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0] Abort trap ruby -v: ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10] -Adam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Re: Hpricot segfault OSX - ruby1.9.1
Wow. Ruby_fu. # = 64bit -Adam On 16/09/2009, at 2:25 PM, Wayne Meissner wrote: e.g. ruby -e 'puts 0xfee1deadbeef.is_a?(Fixnum) ? 64bit : 32bit' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Re: Hpricot segfault OSX - ruby1.9.1
I hope that it isn't something like the gem using a guess on mac as to 'site_ruby' and macports is being circumvented. Anecdotal evidence from others using ruby 1.9.1 is that it's only me... What does `gem env` output? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Adding timestamps to image refs in CSS and JS
So, I'm still running old school and using static css and js in /public. My CSS files have refs to images and the don't have a timestamps appended. i.e. .my_class { background:url(/images/blah.png); } becoming .my_class { background:url(/images/blah.png?11); } How are you guys doing that? Mark -- Mark Mansour m...@agilebench.com http://agilebench.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Re: Adding timestamps to image refs in CSS and JS
With a server that adds etags. Apache + Passenger does nicely -- Myles Eftos Mobile: +61-409-293-183 MadPilot Productions - Created to be Different URL: http://www.madpilot.com.au Phone: +618-6424-8234 Fax: +618-9467-6289 Try our time tracking system: 88 Miles! http://www.88miles.net From: rails-oceania@googlegroups.com [mailto:rails-ocea...@googlegroups.com] On Behalf Of Mark Mansour Sent: Wednesday, 16 September 2009 10:44 PM To: rails-oceania@googlegroups.com Subject: [rails-oceania] Adding timestamps to image refs in CSS and JS So, I'm still running old school and using static css and js in /public. My CSS files have refs to images and the don't have a timestamps appended. i.e. .my_class { background:url(/images/blah.png); } becoming .my_class { background:url(/images/blah.png?11); } How are you guys doing that? Mark -- Mark Mansour m...@agilebench.com http://agilebench.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Re: Adding timestamps to image refs in CSS and JS
Hey Myles, You have answered my question. Thankyou. This is one of those areas I should have been clearer in. The desired effect I'm going for is that the static assets are requested one per deployment (that is good enough for me right now). currently I'm adding etags which still have the browser send requests to the server, in which case the server sends back a 304 Not Modified. Which is better than retransmitting the image each time, but I'd like to remove the entire round trip. What I want is the effect that timestamps with an expires/last modified set like a year in the future (I can never remember whether it is expires or last-modified) so that the same asset is brought out of browser cache rather than re-querying the server and getting a 304. So I can do this for normal rails assets that have the timestamp thrown on the end, but I'm not sure how to do it with the images inside my JS and CSS files. I hope that is a bit clearer. Mark On Thu, Sep 17, 2009 at 1:00 AM, Myles Eftos my...@madpilot.com.au wrote: With a server that adds etags. Apache + Passenger does nicely -- Myles Eftos Mobile: +61-409-293-183 MadPilot Productions - Created to be Different URL: http://www.madpilot.com.au Phone: +618-6424-8234 Fax: +618-9467-6289 Try our time tracking system: 88 Miles! http://www.88miles.net From: rails-oceania@googlegroups.com [mailto:rails-ocea...@googlegroups.com] On Behalf Of Mark Mansour Sent: Wednesday, 16 September 2009 10:44 PM To: rails-oceania@googlegroups.com Subject: [rails-oceania] Adding timestamps to image refs in CSS and JS So, I'm still running old school and using static css and js in /public. My CSS files have refs to images and the don't have a timestamps appended. i.e. .my_class { background:url(/images/blah.png); } becoming .my_class { background:url(/images/blah.png?11); } How are you guys doing that? Mark -- Mark Mansour m...@agilebench.com http://agilebench.com/ -- Mark Mansour m...@agilebench.com http://agilebench.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Re: Adding timestamps to image refs in CSS and JS
If you are talking last-modified vs expires, you want expires, as last-modified will still do a server request (that should return 304). You should be able to get your webserver to send an expires header. Of course that doesn't force a reload the way a ?timestamp does, but short of generating the css dynamically, there isn't much you can do about that. You could probably write a rake task that parses the CSS, and inserts the timestamp on deployment. -- Myles Eftos Mobile: +61-409-293-183 MadPilot Productions - Created to be Different URL: http://www.madpilot.com.au Phone: +618-6424-8234 Fax: +618-9467-6289 Try our time tracking system: 88 Miles! http://www.88miles.net -Original Message- From: rails-oceania@googlegroups.com [mailto:rails- ocea...@googlegroups.com] On Behalf Of Mark Mansour Sent: Wednesday, 16 September 2009 11:28 PM To: rails-oceania@googlegroups.com Subject: [rails-oceania] Re: Adding timestamps to image refs in CSS and JS Hey Myles, You have answered my question. Thankyou. This is one of those areas I should have been clearer in. The desired effect I'm going for is that the static assets are requested one per deployment (that is good enough for me right now). currently I'm adding etags which still have the browser send requests to the server, in which case the server sends back a 304 Not Modified. Which is better than retransmitting the image each time, but I'd like to remove the entire round trip. What I want is the effect that timestamps with an expires/last modified set like a year in the future (I can never remember whether it is expires or last-modified) so that the same asset is brought out of browser cache rather than re-querying the server and getting a 304. So I can do this for normal rails assets that have the timestamp thrown on the end, but I'm not sure how to do it with the images inside my JS and CSS files. I hope that is a bit clearer. Mark On Thu, Sep 17, 2009 at 1:00 AM, Myles Eftos my...@madpilot.com.au wrote: With a server that adds etags. Apache + Passenger does nicely -- Myles Eftos Mobile: +61-409-293-183 MadPilot Productions - Created to be Different URL: http://www.madpilot.com.au Phone: +618-6424-8234 Fax: +618-9467-6289 Try our time tracking system: 88 Miles! http://www.88miles.net From: rails-oceania@googlegroups.com [mailto:rails- ocea...@googlegroups.com] On Behalf Of Mark Mansour Sent: Wednesday, 16 September 2009 10:44 PM To: rails-oceania@googlegroups.com Subject: [rails-oceania] Adding timestamps to image refs in CSS and JS So, I'm still running old school and using static css and js in /public. My CSS files have refs to images and the don't have a timestamps appended. i.e. .my_class { background:url(/images/blah.png); } becoming .my_class { background:url(/images/blah.png?11); } How are you guys doing that? Mark -- Mark Mansour m...@agilebench.com http://agilebench.com/ -- Mark Mansour m...@agilebench.com http://agilebench.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Re: Adding timestamps to image refs in CSS and JS
You can always do it by hand (?1, ?2, etc), or rename the file. Justin French On 17/09/2009, at 12:44 AM, Mark Mansour m...@stateofflux.com wrote: So, I'm still running old school and using static css and js in / public. My CSS files have refs to images and the don't have a timestamps appended. i.e. .my_class { background:url(/images/blah.png); } becoming .my_class { background:url(/images/blah.png?11); } How are you guys doing that? Mark -- Mark Mansour m...@agilebench.com http://agilebench.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---
[rails-oceania] Re: Hpricot segfault OSX - ruby1.9.1
What does `gem env` output? The usual: RubyGems Environment: - RUBYGEMS VERSION: 1.3.1 - RUBY VERSION: 1.9.1 (2009-07-16 patchlevel 243) [i386-darwin10] - INSTALLATION DIRECTORY: /opt/local/lib/ruby1.9/gems/1.9.1 - RUBY EXECUTABLE: /opt/local/bin/ruby1.9 - EXECUTABLE DIRECTORY: /opt/local/bin - RUBYGEMS PLATFORMS: - ruby - x86-darwin-10 - GEM PATHS: - /opt/local/lib/ruby1.9/gems/1.9.1 - /var/root/.gem/ruby/1.9.1 - GEM CONFIGURATION: - :update_sources = true - :verbose = true - :benchmark = false - :backtrace = false - :bulk_threshold = 1000 - :sources = [http://gems.rubyforge.org/;, http://gems.github.com ] - gem = --no-rdoc --no-ri - REMOTE SOURCES: - http://gems.rubyforge.org/ - http://gems.github.com ... but I found the issue: [a...@omegatron ~/dev/temp] which rails /usr/bin/rails [a...@omegatron ~/dev/temp] which ruby /opt/local/bin/ruby I'm guessing OSX has a rails binary installed by default... I've just rm -rf my whole macports... sigh -Adam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby or Rails Oceania group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~--~~~~--~~--~--~---