osx-snow-leopard

Creating an IMP from an Objective-C block

旧街凉风 提交于 2019-11-28 19:09:07
问题 The IMP type in Objective-C represents a function pointer, as far I as understand. Is there any way to make an IMP from a block pointer? Thanks for your ideas. 回答1: Since this was written there is now API in iOS and Mac OS X that allows Blocks to be turned into IMPs directly. I wrote up a weblog post describing the API (imp_implementationWithBlock()). A block is effectively a structure that contains a bit of metadata, a reference to the code contained within the block and a copy of the const

Install mysql2 gem on Snow Leopard for Rails 3 with rvm

本小妞迷上赌 提交于 2019-11-28 18:38:17
I have recently upgraded to Rails 3 and created a new application with Rails 3.0.3, but I keep getting an error Macintosh:$ rails server => Booting WEBrick => Rails 3.0.3 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-11-28 11:32:47] INFO WEBrick 1.3.1 [2010-11-28 11:32:47] INFO ruby 1.8.7 (2010-04-19) [i686-darwin10.4.0] [2010-11-28 11:32:47] INFO WEBrick::HTTPServer#start: pid=1055 port=3000 Started GET "/" for 127.0.0.1 at Sun Nov 28 11:32:52 +0000 2010 RuntimeError (!!! Missing the mysql2 gem. Add it to your Gemfile:

Homebrew install permissions issue

蓝咒 提交于 2019-11-28 16:59:30
I have a standard homebrew install inside of usr/local/ When I try: Larson-2:~ larson$ brew install postgresql Error: Cannot write to /usr/local/Cellar And when I use sudo: Larson-2:~ larson$ sudo brew install postgresql Cowardly refusing to `sudo brew install' What am I doing wrong? You somehow have limited permissions to /usr/local/Cellar . Brew doesn't like to install with sudo which is why it refuses. Check the permissions: ls -ld /usr/local/Cellar Open them up for writing: sudo chmod a+w /usr/local/Cellar Do not use sudo when working with brew (for security reasons). You've to simple set

Install PECL on Mac OS X 10.6

守給你的承諾、 提交于 2019-11-28 16:14:02
Is there any way to install PHP:s PECL handler on Mac OS X 10.6, to be used with the bundled PHP? numberwhun Better late than never, but if you are like me and installed PHP directly from php.net (instead of using something like Homebrew or Port, then you can simply follow the following link to install Pear and PECL: http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/ We need PEAR! For some reason, it's not set up ready to on Lion, but the install phar file is here, so we just need to run it. cd /usr/lib/php sudo php install-pear-nozlib.phar Edit: /etc/php.ini and find the line: ;

Homebrew , python installing

[亡魂溺海] 提交于 2019-11-28 15:44:47
问题 i got an error while trying to install python throught homebrew. brew says what it failed to link python , here is output: Linking /usr/local/Cellar/python/2.7.3... Warning: Could not link python. Unlinking... Error: Could not symlink file: /usr/local/Cellar/python/2.7.3/bin/smtpd2.py /usr/local/bin/smtpd2.py may already exist. /usr/local/bin may not be writable. ls -la on /usr/bin and bin rights : The drwxrwxrwx 26 root admin 884 26 Oct 16:03 bin And smtpd2.py is exists.. How can i fix it?

How to create a helper application (LSUIElement) that also has a (removable) dock icon

孤者浪人 提交于 2019-11-28 12:20:44
I've submitted a helper application (using LSUIElement)to the Mac App Store. I was under the false impression that the App Store install process would put a dock icon for helper apps. How can I create a dock icon that the user could remove, while the status bar app runs independently (like the popular app Caffeine)? Do I need to create a non-LSUIElement app that loads the LSUIElement app, or is there a better way? Instead of using LSUIElement, use NSApplication's setActivationPolicy: method. By default, the application will have a dock icon, but by changing the activation policy to

rake db:create - collation issues

白昼怎懂夜的黑 提交于 2019-11-28 11:33:10
kratos-iii:railsproj zachinglis$ rake db:create (in /Users/zachinglis/Sites/rails/railsproj) Couldn't create database for {"adapter"=>"mysql", "host"=>"localhost", "username"=>"root", "password"=>nil, "database"=>"railsproj_development"}, charset: utf8, collation: utf8_general_ci (if you set the charset manually, make sure you have a matching collation) I had no issues using Sequel Pro and even creating said database. How do I resolve this? Having an empty password never gave me issues before. And I really doubt thats it. bobsouza I was having the same problem than you, me and my friends were

Compiling opencv samples: unknown cmake command ocv_check_dependencies

岁酱吖の 提交于 2019-11-28 09:56:38
I am trying to build the OpenCV samples which come with the source package and I get the following: CMake Error at CMakeLists.txt:10 (ocv_check_dependencies): Unknown CMake command "ocv_check_dependencies". I did install OpenCV using cmake . make sudo make install and I got a tutorial snippet working (thus I suppose it is installed correctly as a library). However, compiling the samples does not work. I guess I have to somehow configure CMake to have “ocv_check_dependencies” - but how? I am lost! Zzirconium Actually for OpenCV 2.4.4 beta the root CMakeList.txt file says: OCV_OPTION(BUILD

How to deploy to Snow Leopard with ARC enabled

拥有回忆 提交于 2019-11-28 09:21:56
I have an OSX app that I would like to migrate to ARC. Everything works fine if I set the base SDK to 10.7. But when I set it to 10.6 it does not work ( because it does not find _objc_release etc.). So how do I deploy my app to 10.6 with ARC enabled? You set the SDK to 10.7 but the Deployment Target to 10.6. Keep in mind: While it's possible to build programs using ARC that run on Mac OS X 10.6 and iOS 4, zeroing weak references are not available on those OSes. All weak references must be __unsafe_unretained here. Because non-zeroing weak references are so dangerous, this limitation

Installing mysql2 gem for Ruby on Rails with Mac OSX 10.6

倾然丶 夕夏残阳落幕 提交于 2019-11-28 07:16:48
I am having a problem installing the mysql2 gem. This comes up when I do gem install mysql2 : Marks-MacBook-Pro:~ Mark$ gem install mysql2 Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. /Users/useruser/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb checking for rb_thread_blocking_region()... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no