2年后,我想再次使用ruby on rails,我已经尝试重新启动我的项目,但它没有工作,我按照我的指示2年前写的。我认为应用程序有一些依赖性问题或者我不知道,你能给我一些建议我如何找到问题的根源,我试过谷歌。
我试过了:
bundle update
bundle install
rake db:create
bundle pack
rake install
当我使用rake db:create或其他rake命令时,我收到以下错误:
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called.
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile
rake aborted!
no such file to load -- rspec
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `block in require'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:596:in `new_constants_in'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `load_dependency'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/bundler/gems/rspec-rails-matchers-488d2cadcd9f/lib/rspec-rails-matchers.rb:1:in `<top (required)>'
/home/elemer/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/home/elemer/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/home/elemer/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/home/elemer/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/home/elemer/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/home/elemer/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/home/elemer/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/home/elemer/railsapp/newest/railsapp/config/application.rb:7:in `<top (required)>'
/home/elemer/railsapp/newest/railsapp/Rakefile:4:in `require'
/home/elemer/railsapp/newest/railsapp/Rakefile:4:in `<top (required)>'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/elemer/railsapp/newest/railsapp/rails/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/home/elemer/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval'
/home/elemer/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
如果您有任何想法,请与我分享。谢谢。
我的宝石文件:
source 'http://rubygems.org'
gem 'rails', '3.0.9'
gem 'rake'
# Bundle edge Rails instead:
# gm 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'sqlite3-ruby', :require => 'sqlite3'
gem "cancan"
gem 'racc'
gem 'jquery-rails'
gem 'paperclip', '2.3.8'
gem 'workflow'
gem 'pg'
gem 'prawn' # for pdf creation
gem 'yaml_db'
gem 'net-ldap'
gem 'whenever', :require => false
gem 'zip'
gem "bcrypt-ruby", :require => "bcrypt"
gem 'kaminari'
gem 'remotipart'
gem 'meta_where'
gem 'meta_search'
gem 'delayed_job'
gem 'rack-ssl', :require => 'rack/ssl'
gem 'dalli'
#gem 'silent-postgres'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
group :cucumber, :test, :development do
gem "autotest"
gem 'cucumber'
gem 'cucumber-rails'
gem 'rspec-rails', '~> 2.4'
gem 'sqlite3'
gem 'silent-postgres'
gem 'selenium-webdriver'
gem "bermuda"
gem 'capybara', '1.1.1'
gem 'rspec-rails-matchers', :git => "http://github.com/afcapel/rspec-rails-matchers.git"
gem 'simplecov'
gem 'simplecov-rcov'
gem 'launchy'
gem 'factory_girl', '2.1.0'
gem 'factory_girl_rails', '1.2.0'
gem 'database_cleaner'
end
答案 0 :(得分:1)
答案是信息。根据您的Gemfile,黄瓜位于:development和:test组。它应该只在:测试组中。
group :cucumber, :test, :development do
gem "autotest"
gem 'cucumber'