1

我正在尝试使用 (https://github.com/prove/tarantula) 上的文档在 Fedora(内核 3.6.5-2.fc16.x86_64)上安装 Tarantula( http://www.testiatarantula.com/ )。

我遇到的问题是 Ruby 错误 (A) :

/opt/tarantula/config/initializers/session_store.rb:3: syntax error, unexpected ':', 
expecting $end ...sion_store :cookie_store, key: '_tarantula_session'
                                              ^

Tasks: TOP => db:schema:load => environment
(See full trace by running task with --trace)

执行命令时:

 sudo RAILS_ENV=test bundle exec rake tarantula:install

 bundle exec

命令用于克服另一个错误(B):

sudo RAILS_ENV=production rake tarantula:install 
[sudo] password for admin: 
rake aborted!
You have already activated rake 10.0.2, but your Gemfile requires rake 0.9.2.2. Using   
bundle exec may solve this.
/opt/tarantula/config/boot.rb:6
/opt/tarantula/config/application.rb:1
/opt/tarantula/Rakefile:5
(See full trace by running task with --trace)

错误(A)可以追溯到https://github.com/prove/tarantula/blob/master/config/initializers/session_store.rb

使用

--trace

输出是:

sudo RAILS_ENV=production rake tarantula:install --trace
rake aborted!
You have already activated rake 10.0.2, but your Gemfile requires rake 0.9.2.2. Using bundle exec may solve this.
/usr/lib/ruby/gems/1.8/gems/bundler-1.2.2/lib/bundler/runtime.rb:31:in `setup'
/usr/lib/ruby/gems/1.8/gems/bundler-1.2.2/lib/bundler/runtime.rb:17:in `setup'
/usr/lib/ruby/gems/1.8/gems/bundler-1.2.2/lib/bundler.rb:116:in `setup'
/usr/lib/ruby/gems/1.8/gems/bundler-1.2.2/lib/bundler/setup.rb:7
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:59:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:59:in `require'
/opt/tarantula/config/boot.rb:6
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/opt/tarantula/config/application.rb:1
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/opt/tarantula/Rakefile:5
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:581:in `raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:87:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:86:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:70:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:68:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/bin/rake:37
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
4

2 回答 2

0

指定要在 Gemfile 中使用的 rake 版本:

gem 'rake', '=0.9.2.2'

bundle update

于 2012-11-19T19:47:02.257 回答
0

用这条线试试你session_store.rb的:

Tarantula::Application.config.session_store :cookie_store, :key => '_tarantula_session'

您正在运行的 Ruby 版本是什么?我怀疑它是 1.8.7 吗?

ruby -v对于 Ruby 版本。

编辑

wrap_parameters.rb第 8 行:

wrap_parameters :format => [:json] 
于 2012-11-19T20:55:27.513 回答