运行rspec时遇到麻烦

时间:2015-06-21 20:33:18

标签: ruby-on-rails ruby rspec

我试图运行rspec,但是出现了以下错误。

/Users/xy/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.4/lib/bundler.rb:317: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/Users/xy/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.4/lib/bundler.rb:317: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
You are using Curb 0.7.10. WebMock supports version >= 0.7.16.
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from extend at /Users/xy/ht-webapp12/config/initializers/mysql2_column_cache.rb:3)
/Users/xy/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)

有谁知道如何修复它?

1 个答案:

答案 0 :(得分:1)

尝试:

bundle exec rspec

问题是,如果你没有使用bundle运行rspec,它将使用你的最新系统库,它们可能与你项目中捆绑的版本不同

阅读完答案后,更新您的Gemfile以使路边大于0.7.16,在看到您的GemfileGemfile.lock后,我可以为您提供正确的路线。

但是你应该检查Gemfile.lock的内容,并检查curb加载哪个版本的版本,只需检查依赖它的库并更新那些库,这将更新你的路边,否则您可以使用desider版本在Gemfile上添加curb作为一项要求,其他库可能会编译,但您应该能够修复冲突。

如果您不想要任何这些方法,只需将rspec降级到适用于早期版本的curb的早期版本。

相关问题