如何在Ubuntu中为RSpec设置全局配置.
具体来说, - color和--format specdoc在我的所有项目中保持打开状态(即每次我在任何地方运行rspec).
像其他一些人一样,当我在我的项目中运行rake db:migrate或者甚至为我的Ruby on Rails 3.2应用程序尝试大多数数据库任务时,我收到此错误.
PGError(无法连接到服务器:没有这样的文件或目录.服务器是否在本地运行并接受Unix域套接字上的连接"/tmp/.s.PGSQL.5432"?
很久以前我用Homebrew安装了PostgreSQL,并且在最近尝试安装MongoDB后,我的PostgreSQL安装从未如此.我正在运行OS X v10.6 Snow Leopard.
出了什么问题,我怎么能更好地理解PostgreSQL是如何设置在我的Mac上的呢?
到目前为止(我认为)这告诉我PostgreSQL没有运行(?).
ps -aef|grep postgres (ruby-1.9.2-p320@jct-ana) (develop) ?
501 17604 11329 0 0:00.00 ttys001 0:00.00 grep postgres
Run Code Online (Sandbox Code Playgroud)
但这是否告诉我PostgreSQL正在运行?
? launchctl load -w /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist (ruby-1.9.2-p136)
homebrew.mxcl.postgresql: Already loaded
Run Code Online (Sandbox Code Playgroud)
我该如何解决?我没看到什么?
PS:~/Library/LaunchAgents包含两个PostgreSQL .plist文件.我不确定这是否相关.
org.postgresql.postgres.plist
homebrew.mxcl.postgresql.plist
Run Code Online (Sandbox Code Playgroud)
我尝试了下面的结果,得到了如下结果.
$ psql -p 5432 -h localhost
psql: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on …Run Code Online (Sandbox Code Playgroud) 嗨,我正在寻找写得很好的Cocoa Touch iPhone应用程序的例子,以帮助我看到好的可可代码看起来像什么.
特别是我对人们如何布置标准导航应用感兴趣.
我也对不同的人如何布局模型/视图/控制器文件以及一般命名约定等感兴趣.
使用核心数据的代码也很有趣.
如何从基于命令行的ruby程序颜色输出put命令?我很感激任何关于我如何称呼每种不同颜色的参考.
让我们说我们从这开始..
puts "The following word is blue.. Im Blue!"
puts "The following word is green.. Im Green!"
puts "The following word is red.. Im Red!"
Run Code Online (Sandbox Code Playgroud)
我得到了我想要的不同颜色的不同文字,你得到了这个想法.
我使用Ubuntu,我需要改变我的方法,以便程序在diff os中正确输出吗?
寻找一个好的工具/ gem,可以为现有的rails应用程序自动生成漂亮的UML图.
(我想象这样一个工具会读取schema.rb文件,然后扫描模型的关系)
我正在尝试在我的一个表中添加一个额外的字段.
我在迁移文件中添加了该字段(在db\migrate下),然后运行了'rake db:migrate',它运行没有麻烦.我的文本编辑器甚至告诉我我的schema.db文件已经更新,需要刷新.
模式文件不包含我的新字段,任何从我的视图引用该字段的尝试都会失败.
我该怎么做呢?可以通过rails更新带有额外字段的表,而不必完全删除并重新创建数据库吗?
当我在rails应用程序上从命令提示符运行spec时.
$ spec spec
我收到以下错误:
/Library/Ruby/Site/1.8/rubygems.rb:335:in"bin_path':找不到/ usr/bin/spec中rspec-2.0.0.beta.22(Gem :: Exception)的可执行规范: 19
但是,当我跑
$ rake spec
测试运行良好.
有什么问题?
我正在寻找将字符串从驼峰格式转换为标题案例格式的最简单方法.
如何将"playerName"更改为"玩家姓名"?
在其他o/s RSpec返回漂亮的彩色结果(红色,绿色等).
但是在Windows(Vista)命令提示符下,我的文本输出只是普通的老无聊白色.
如何为我的RSpec测试结果带来颜色?
谢谢
发展
当我转到'运行功能'时,从黄瓜功能文件中我在出现的弹出框中收到以下错误.
我该如何解决?
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require'from gem_original_require': no such file to load -- /Users/evolve/Projects/i9/Tornelo/.bundle/environment (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in/ Users/evolve/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate /../ mate.rb:10来自/ Users/evolve/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/feature_helper.rb:1:in require' from /Users/evolve/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/feature_helper.rb:1 from /tmp/cucumber-906.rb:2:inrequire'from /tmp/cucumber-906.rb :2
ruby ×4
rspec ×3
colors ×2
camelcasing ×1
cocoa ×1
cocoa-touch ×1
command-line ×1
cucumber ×1
dbmigrate ×1
homebrew ×1
iphone ×1
objective-c ×1
postgresql ×1
schema.rb ×1
string ×1
uml ×1
windows ×1