I am trying to install Tarantula ( http://www.testiatarantula.com/ ) on Fedora (kernel 3.6.5-2.fc16.x86_64) using the documentation at (https://github.com/prove/tarantula) .
The issue I ran into is Ruby error (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)
when executing the command :
sudo RAILS_ENV=test bundle exec rake tarantula:install
The
bundle exec
command is used to overcome another error (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)
Error (A) can be traced back to https://github.com/prove/tarantula/blob/master/config/initializers/session_store.rb .
Using
--trace
the outputs are:
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
Try your session_store.rb with this line:
Tarantula::Application.config.session_store :cookie_store, :key => '_tarantula_session'
Whats the Ruby Version you are running? I'm doubting it's 1.8.7 ?
ruby -v for Ruby version.
EDIT
And wrap_parameters.rb with this on line 8:
wrap_parameters :format => [:json]
Specify the version of rake to use in your Gemfile:
gem 'rake', '=0.9.2.2'
and bundle update
Related
I am attempting to run rake under Mac OSX and I am getting the below error.
$ rake --trace
rake aborted!
Gem::ConflictError: Unable to activate releasy-0.2.2, because rake-10.3.2 conflicts with rake (~> 0.9.2.2)
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:2112:in `raise_if_conflicts'
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:1280:in `activate'
/Library/Ruby/Site/2.0.0/rubygems.rb:198:in `rescue in try_activate'
/Library/Ruby/Site/2.0.0/rubygems.rb:195:in `try_activate'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require'
/Users/Development/RUBY/rakefile:5:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:687:in `raw_load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:94:in `block in load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:93:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:77:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
gem list --local displays
rake (10.3.2, 0.9.6, 0.9.2.2)
How would I resolve a conflict between the rake gem I installed and the rake gem that is deployed with OSX? Should I just delete the newest update or is there a way to specify in my rake file to use the newest version and ignore the conflict?
If you are trying to run rake from within a project that uses a Gemfile, try this:
bundle exec rake --trace
This will load up the version of rake required for the project, instead of one that could possibly conflict (like your OSX default /usr/bin/rake binary).
If the bundle command isn't found, do this:
gem install bundler
Also, if this is a recent Rails app, you can also use the provided binstubs instead like this:
bin/rake --trace
If none of this works, try using RVM, Chruby, or RBEnv to manage your Ruby environments separately from the operating-system provided Ruby.
I'm trying to work through the Ruby course from TestFirst.org. It requires you to navigate to the folder containing the exercise, run rake, and then correct any errors in the source code it uncovers. When I run rake in the folder for the first exercise it gives this error:
rake aborted!
Could not find rspec (~> 2) amongst [diff-lcs-1.2.5, rspec-3.0.0, rspec-core-3.0.0,
rspec- expectations-3.0.0, rspec-mocks-3.0.1, rspec-support-3.0.0]
/home/jayson/Desktop/learn_ruby/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)
Does this means it will only work with an old version of rspec or something else? Running rake with --trace gives me:
rake aborted!
Could not find rspec (~> 2) amongst [diff-lcs-1.2.5, rspec-3.0.0,
rspec-core-3.0.0, rspec-expectations-3.0.0, rspec-mocks-3.0.1, rspec-support-3.0.0]
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs'
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
/usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
/home/jayson/Desktop/learn_ruby/Rakefile:2:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:589:in `raw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:89:in `block in load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:88:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:72:in `block in run'
/usr/lib/ruby/vendor_ruby/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:70:in `run'
/usr/bin/rake:27:in `<main>'
How do I get the rake command to work properly? I'm using Terminal in Ubuntu 14.04, with Ruby 1.9.3, RubyGems 1,8.23, and Rspec 3.0.0. Thanks in advance.
I had the same problem, and sudo gem install -v '<3.0.0' rspec did work, but only after I uninstalled the newer version with gem uninstall rspec.
Without that uninstall first, only the later version remains active and the problem will continue.
hope this help.
gem install rspec -v 2.9.0
It happen because:
Could not find rspec (~> 2)
while rspec version installed on your machine is: rspec-3.0.0
Source: RubyGems
I was trying to setup facebook app locally, using ruby and sinatra, in Kubuntu 12.04.
I have included following gems in my gemfile. I have postgresql installed in my system and I am able to run the postgresql command line and run basic commands as createdb, create table etc.
gem "sinatra"
gem "koala"
gem "json", "1.5.5"
gem "httparty"
gem "thin"
gem "rack", "1.3.10"
gem "pg"
gem "activerecord"
gem "sinatra-activerecord"
And in my app.rb file added these files,
require "rubygems"
require "sinatra"
require "sinatra/activerecord"
require "koala"
require "./config/environment" #database configuration
Running
rake -T
in my terminal gives me the following error.
rake aborted!
(<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 1
/var/lib/gems/1.9.1/gems/sinatra-activerecord-1.2.2/lib/sinatra/activerecord.rb:39:in `database_file='
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1033:in `set'
/var/lib/gems/1.9.1/gems/sinatra-activerecord-1.2.2/lib/sinatra/activerecord.rb:50:in `registered'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1317:in `block in register'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1315:in `each'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1315:in `register'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1648:in `register'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1688:in `register'
/var/lib/gems/1.9.1/gems/sinatra-activerecord-1.2.2/lib/sinatra/activerecord.rb:76:in `<module:Sinatra>'
/var/lib/gems/1.9.1/gems/sinatra-activerecord-1.2.2/lib/sinatra/activerecord.rb:6:in `<top (required)>'
/home/nitin/facebook_app/guarded-gorge-3234/app.rb:3:in `<top (required)>'
/home/nitin/facebook_app/guarded-gorge-3234/Rakefile:1:in `<top (required)>'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
Could any one please help. Thank you.
As #iain mentioned, this is due to a parse error in your config/database.yml file.
Check that it is valid syntax, and replace any tabs with spaces.
I'm trying to install Redmine based on Official Wiki, but when I try to run rake generate_secret_token the following error shows
rake aborted!
Don't know how to build task 'generate_secret_token'
I already went into this question with no success
Redmine: rake error when installing
** For the problem above, I believe running the command rake secret has resolved, cause no generate_secret_token is listed when I call rake -T **
And when I try to run RAILS_ENV=production rake redmine:load_default_data I get
rake aborted!
Don't know how to build task 'redmine:load_default_data'
Following is the trace:
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rak /task_manager.rb:49:in `[]'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:115:in `invoke_task'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `load'
/home/nuno/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `<main>'
/home/nuno/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/home/nuno/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
The generate_secret_token task is only available for Redmine >= 2.0.0. If you use an older version (which seems likely), the related task is called generate_session_store As such, try
bundle exec rake generate_session_store
At end I solved my problem installing Bitnami's package for Redmine http://bitnami.com/stack/redmine
I decided to go through the tutorial. After I create a new app and add new user:string email:string and then perform rake db:migrate in the app directory, I get this output:
rake aborted!
undefined method `task' for #<DemoApp::Application:0x00000100e49e08>
/usr/local/rvm/gems/ruby-1.9.2-p180#rails3tutorial/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
/usr/local/rvm/gems/ruby-1.9.2-p180#rails3tutorial/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/usr/local/rvm/gems/ruby-1.9.2-p180#rails3tutorial/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/Users/zigloo99/rails_projects/demo_app/Rakefile:7:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:78:in `block in load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:61:in `block in run'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/bin/rake:31:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p180#global/bin/rake:19:in `<main>'
I am using RVM too ruby 1.9.2 and rails 3.0.7 as in the tutorial.
Any thoughts?
This is happening because the latest version of Rake (0.9.0) is broken on Rails 3.0 applications and we are currently awaiting a solid fix.
Right now, a way around this error is to add this line above the load_tasks line in your application's Rakefile:
<AppName>::Application.send :include, ::Rake::DSL if defined?(::Rake::DSL)
Another solution is to require rake 0.8.7 in your Gemfile before starting a new rails project.
# Gemfile
gem 'rake', '0.8.7', :require => 'rake'
then run bundle install