我遇到了一个让我陷入困境一天半的问题,我想要一些帮助.
我一直在我的iMac和我的macbook pro之间移动我最新的rails 3应用程序,只需一个简单的副本,直到现在,我没有遇到任何问题.
fyi,我使用rvm来管理我的项目版本.
我有一个新的iMac,安装了Lion,在我运行捆绑更新之前,一切似乎都很好.从那时起,我一直无法让捆绑器工作.构建gem原生扩展时会出现问题.
一旦我运行捆绑更新,我的iMac(osx lion)机器上的任何设备都无效.我可以继续在我的笔记本电脑上运行捆绑更新(Snow Leopard).
所以我希望能够在我的Lion机器上继续开发.这是我到目前为止所做的:
最初,我在编译器方面遇到了一些错误,但是由于我重新安装了xcode并运行了安装程序,我不再是那些错误了.
我仍然继续在我的nokogiri版本上出错.有一次,我遵循了一些博客说明(并做了:
sudo port upgrade --enforce-variants libxml2 +universal
Run Code Online (Sandbox Code Playgroud)
但它似乎对建立nokogiri没有任何区别.
现在,当我进行捆绑更新时,我得到:
Installing nokogiri (1.5.0) with native extensions /Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for …Run Code Online (Sandbox Code Playgroud) 我使用PostgreSQL 9.1(来自官方发行版,而不是内置版本)安装并与MacOS Lion中的浏览器很好地对话.但是我无法使用ODBC.我安装了XCode以获得所需的libltdl.3.dylib,以及psqlODBC驱动程序.然后我在/usr/lib/libltdl.3.dylib中创建了一个符号链接,以便psqlODBC找到该库.psqlODBC在iodbcinst.ini中注册.但是,当我尝试打开连接时,我得到两个不同的错误.在iodbctest:
1: SQLDriverConnect = [iODBC][Driver Manager]dlopen({/Library/PostgreSQL/psqlODBC/lib/psqlodbcw.so}, 6): image not found (0) SQLSTATE=00000
2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
Run Code Online (Sandbox Code Playgroud)
并通过一个应用程序:
[iODBC][Driver Manager]dlopen(/Library/PostgreSQL/psqlODBC/lib/psqlodbcw.so, 6): Library not loaded: /usr/lib/libltdl.3.dylib
Referenced from: /Library/PostgreSQL/psqlODBC/lib/psqlodbcw.so
Reason: no suitable image found. Did find:
/usr/lib/libltdl.
Run Code Online (Sandbox Code Playgroud)
这两个错误令人费解.psqlodbcw.so正是它应该的位置,libltdl.3.dylib也是如此.似乎驱动程序在第一个时期截断了库的文件名,非常奇怪.有什么想法吗?
我不情愿地从雪豹更新到狮子.然后我将XCode更新为4.3.1,作为更新的一部分从雪豹中卸载了4.2.然后我意识到我的其他开发工具之一根本不适用于4.3.1,所以我安装了4.2.1并希望能解决问题.它没有.如何删除4.2.1所以我只剩下4.3.1了?我尝试删除4.3.1并重新安装,希望它能检测到4.2.1并将其删除,就像我第一次升级但没有骰子时那样.搜索网页显示我需要运行uninstall-devtools然而我无法在任何地方找到它/开发人员不存在...试图重新安装4.2.1希望有一个安装在那里的卸载程序说"Xcode安装助手无法安装,因为xcode已经安装"(显然没有第一次这么说)所以我不能在没有4.3.1的情况下重新安装,希望得到一个/ Developer文件夹. 4.3.1中似乎没有卸载devtools(我也安装了命令行工具).我找不到4.2.1,也许它没有安装(我忘了检查之前/之后的光盘容量)但是为什么我不能在没有安装任何xcode的情况下再次安装它?
我安装了pynum和scipy(在osx Lion上使用python 2.7),但当我尝试构建matplotlib时
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
python setup.py build
python setup.py install
Run Code Online (Sandbox Code Playgroud)
我有这些错误:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h:242: error: declaration for parameter ‘FMFontDirectoryFilter’ but no such parameter
src/_macosx.m:5912: error: expected ‘{’ at end of input
lipo: can't open input file: /var/folders/qw/pr2f7vq91b3c3ngkxrrqplm8zkv09r/T//ccAgEklo.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
有人可以告诉我这是什么问题吗?
PS起初我试图以这种方式安装它:
pip install -e git+https://github.com/matplotlib/matplotlib#egg=matplotlib-dev
Run Code Online (Sandbox Code Playgroud)
但它对我不起作用
我想su对Mac上的postgres用户,以便我可以运行postgres.
我在这做错了什么?
delirium:~ anna$ sudo su postgres
delirium:~ anna$
Run Code Online (Sandbox Code Playgroud)
什么都没发生.如果我尝试运行postgres,那么我得到这样的东西:
delirium:~ anna$ sudo pg_ctl -D /usr/local/var/postgres -l
/usr/local/var/postgres/server.log startpg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.
Run Code Online (Sandbox Code Playgroud)
如果我试试这个su,我也会收到一个错误:
delirium:~ anna$ sudo su - postgres
su: no directory
delirium:~ anna$
Run Code Online (Sandbox Code Playgroud)
我该怎么做?我很确定postgres用户存在.
有谁知道苹果公司正在使用什么apI的Get Info面板来确定Lion的免费空间?我试图获得Apple报告的相同可用空间的所有代码都失败了,甚至Quick Look也没有显示Get Info显示的相同空间.如果我删除一堆文件并尝试读取可用空间,这似乎就会发生.

当我使用NSFileManager - > NSFileSystemFreeSize时,我得到42918273024字节
当我使用NSURL - > NSURLVolumeAvailableCapacityKey时,我得到42918273024字节
当我使用statfs - > buffer.f_bsize*buffer.f_bfree时,我得到43180417024字节
statfs获得与Quick Look类似的结果,但我如何匹配Get Info?
由于一些特殊的身份验证,我必须编写一个Messages插件来访问内部Jabber服务器.我有两个问题:
谢谢.
我最近安装了GitHub for Mac,GitHub的图形Git客户端,以及菜单中的命令行实用程序,如下所示:

我收到通知已安装命令行实用程序/usr/local/github,但当我检查它实际上已被放入/usr/local/bin/github- 详细信息如下所示:

当我尝试运行git我得到-bash: git: command not found了,所以我加入export PATH=/usr/local/bin:$PATH到~/.profile以为它会解决这个问题,但它并没有-所有这些似乎不同的是,我现在可以为Mac从终端键入以下命令启动GitHub上github.
请有更多知识的人解释这里发生了什么?
我有一些代码在过剩窗口中使用PyOpenGL显示图形.在视网膜Macbook Pro上,此窗口以低分辨率模式显示,其中一个OpenGL像素由四个物理像素表示.如果它以完整的原始分辨率显示会更好.
我的问题
有没有办法在Retina显示器上使用过剩或其他方式在Python中获取原生分辨率OpenGL上下文?
问题示例
下面是PyOpenGL程序的最小工作示例.没有什么特别之处 - 任何有效的PyOpenGL代码都会展示这个问题.这是屏幕截图的放大细节.请注意,构成白色三角形的像素是OS X小部件像素大小的四倍.这是不是专门为Retina设备设计的程序的默认设置.我想知道如何为PyOpenGL程序关闭它.

这是代码:
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import os
def initFunc():
glDisable(GL_DEPTH_TEST)
glClearColor(0.0, 0.0, 0.0, 0.0)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluOrtho2D(0.0, 400.0, 0.0, 400.0)
def displayFunc():
glClear(GL_COLOR_BUFFER_BIT)
glColor3f(1.0, 1.0, 1.0)
glBegin(GL_TRIANGLES)
glVertex2f(10.0, 10.0)
glVertex2f(10.0, 100.0)
glVertex2f(100.0, 100.0)
glEnd()
glFlush()
if __name__ == '__main__':
glutInit()
glutInitWindowSize(400,400)
glutCreateWindow("GL test")
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)
glutDisplayFunc(displayFunc)
initFunc()
os.system('''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python" to true' ''')
# …Run Code Online (Sandbox Code Playgroud)