我一直试图在我的Mac上安装rails.我有OS X 10.6.8,我已经确认我有Ruby,版本1.8.7
我跑了sudo gem update并sudo gem update --system获得了该软件的最新版本.
但是,当我运行时,sudo gem install rails我收到此错误:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.6.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.6.3/ext/json/ext/parser/gem_make.out
Run Code Online (Sandbox Code Playgroud) 我必须编写一个Ruby方法:
迭代一个数组,如果其中一个元素匹配某个条件,则执行Foo.
如果没有数组元素符合条件,请执行Bar事务.
在任何其他语言中,我在进入循环之前设置一个布尔变量,如果我做了Foo,则切换它.该变量的值将告诉我是否需要Bar.但这感觉非常不优雅.任何人都可以提出更好的方法吗?
编辑一些非常好的答案,但由于我应该提到的细节,它们不能很好地工作.Foo所做的事情是对匹配条件的数组元素完成的.此外,它保证最多一个元素将匹配条件.
我首先想知道VSTO Excel 2007 Workbook和VSTO Excel 2007加载项之间的区别.
在什么情况下,VSTO excel 2007工作簿或VSTO Excel 2007加载项或两者都是首选.
我想学习使用C#的VSTO Excel 2007和一些很好的例子,并在实时场景中以高水平的使用方式使用它.
请给我一些非常好的链接或网站,并使用C#为我提供一些与VSTO excel2007相关的好电子书,我可以学习更多VSTO excel2007.
请帮助我使用任何电子书或良好的链接来学习或学习相同的东西.
bharathi-1397@bharathi-1397:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/local/bharathi-1397/.ssh/id_rsa):
/home/local/bharathi-1397/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/local/bharathi-1397/.ssh/id_rsa.
Your public key has been saved in /home/local/bharathi-1397/.ssh/id_rsa.pub.
The key fingerprint is:
de:e3:e5:f6:a3:8e:83:76:f0:7d:d6:e1:b3:d6:cc:93 bharathi-1397@bharathi-1397
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| |
| |
| S |
| ... . |
| .+o.. .++|
| …Run Code Online (Sandbox Code Playgroud)