我在rails 2.3.2中有现有的源代码,同时运行rake gems:install它显示错误,如“Ascii85”的“undefined method`name”:String“。
我认为这是因为rubygems版本的问题。我使用的是ruby 1.8.7,rails 2.3.2,gem 1.3.7。
现在我通过运行sudo rake gems:install
解决了上述问题,但现在问题是在运行rake db:migtare
Missing these required gems:
activemerchant = 1.4.1
You're running:
ruby 1.8.7.299 at /usr/bin/ruby1.8
rubygems 1.3.6 at /home/fstech/.rvm/gems/ruby-1.8.7-p302, /home/fstech/.rvm/gems/ruby-1.8.7-p302@global
Run `rake gems:install` to install the missing gems.
但我已经安装了activemerchant gem,这里是gem list
fstech@Blrfstech12:~/workspace/ff$ sudo gem list activemerchant
*** LOCAL GEMS ***
activemerchant (1.15.0, 1.4.1)
fstech@Blrfstech12:~/workspace/ff$
rake gems:install --trace
fstech@Blrfstech12:~/workspace/ff$ rake gems:install --trace
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
RubyGem version error: activesupport(2.2.2 not = 3.0.9)
/usr/local/lib/site_ruby/1.8/rubygems.rb:777:in `report_activate_error'
/usr/local/lib/site_ruby/1.8/rubygems.rb:211:in `activate'
/usr/local/lib/site_ruby/1.8/rubygems.rb:246:in `activate'
/usr/local/lib/site_ruby/1.8/rubygems.rb:245:in `each'
/usr/local/lib/site_ruby/1.8/rubygems.rb:245:in `activate'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:35:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/acts_as_ferret-0.5.2/lib/acts_as_ferret/railtie.rb:2
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/acts_as_ferret-0.5.2/lib/acts_as_ferret.rb:92
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/rails/gem_dependency.rb:179:in `load'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:305:in `load_gems'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:305:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:305:in `load_gems'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:167:in `process'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
/home/fstech/workspace/ff/config/environment.rb:22
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/tasks/misc.rake:4
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/tasks/gems.rake:17
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/bin/rake:32
/home/fstech/.rvm/gems/ruby-1.8.7-p302/bin/rake:19:in `load'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/bin/rake:19
no such file to load -- faraday
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/faraday_middleware-0.6.5/lib/faraday_middleware.rb:1
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/twitter-1.6.0/lib/twitter/connection.rb:1
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/twitter-1.6.0/lib/twitter/api.rb:3
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/twitter-1.6.0/lib/twitter.rb:1
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/rails/gem_dependency.rb:179:in `load'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:305:in `load_gems'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:305:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:305:in `load_gems'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:167:in `process'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
/home/fstech/workspace/ff/config/environment.rb:22
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/tasks/misc.rake:4
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.2/lib/tasks/gems.rake:17
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.9.2/bin/rake:32
/home/fstech/.rvm/gems/ruby-1.8.7-p302/bin/rake:19:in `load'
/home/fstech/.rvm/gems/ruby-1.8.7-p302/bin/rake:19
** Execute gems:install
gem install activemerchant --version "= 1.4.1"
Successfully installed activemerchant-1.4.1
1 gem installed
Installing ri documentation for activemerchant-1.4.1...
Installing RDoc documentation for activemerchant-1.4.1...
有什么问题?
答案 0 :(得分:1)
我觉得没有足够的能力帮助你直接使用这些宝石,但我怀疑你已经运行(并且会运行)因各种版本的已安装宝石而出现问题。我知道宝石的设计是为了帮助,但是......
您可能想尝试使用bundler来帮助您管理gem的版本。查看文章http://blog.tag.ca/using-bundler-with-rails-2。我自己没有测试过(因为我已经从Rails 1直接跳到了Rails 3),但它可以为你节省很多麻烦。