升级Rails应用程序并获取Rake错误

时间:2015-11-01 01:54:27

标签: ruby-on-rails ruby-on-rails-3 rake rvm

我一直在尝试升级我多年没碰过的rails应用程序。我在这里查看了这个答案RoR 3 Undefined Method 'task'但是没有奏效。

我的设置也是这样: ruby 2.2.1p85(2015-02-26修订版49769)[x86_64-darwin14] Rails 4.2.4

当我运行rake db migrate时,我收到以下错误:

    Zacharys-MacBook-Pro:start-stop-note zak$ rake db:migrate
/Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/lib/rake/alt_system.rb:32:in `<module:AltSystem>': uninitialized constant Rake::AltSystem::Config (NameError)
    from /Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/lib/rake/alt_system.rb:31:in `<top (required)>'
    from /Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/lib/rake/win32.rb:3:in `require'
    from /Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/lib/rake/win32.rb:3:in `<module:Rake>'
    from /Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/lib/rake/win32.rb:2:in `<top (required)>'
    from /Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/lib/rake.rb:41:in `require'
    from /Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/lib/rake.rb:41:in `<top (required)>'
    from /Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/bin/rake:26:in `require'
    from /Users/zak/.rvm/gems/ruby-2.2.1/gems/rake-0.8.7/bin/rake:26:in `<top (required)>'
    from /Users/zak/.rvm/gems/ruby-2.2.1/bin/rake:23:in `load'
    from /Users/zak/.rvm/gems/ruby-2.2.1/bin/rake:23:in `<main>'
    from /Users/zak/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/zak/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Zacharys-MacBook-Pro:start-stop-note zak$ 

这是我的宝石文件:

source 'http://rubygems.org'

gem 'rails'
gem 'pg'

# Asset template engines
gem 'sass'
gem 'coffee-script'
gem 'coffeebeans'
gem 'uglifier'
gem 'jquery-rails'
gem 'omniauth'
gem 'cancan'
gem 'heroku'
gem 'acts-as-taggable-on'
gem 'texticle'
gem 'sass-rails'

# Set rake specifically to avoid error on heroku
gem 'rake', '~> 0.8.7'

group :development do
  gem 'populator'
  gem 'heroku_san'
end

group :development, :test do
  gem 'rspec-rails'
  gem 'awesome_print'
end

group :test do
  # Pretty printed test output
  gem 'turn', :require => false

  gem 'autotest'
  gem 'cucumber-rails'
  gem 'capybara'
  gem 'database_cleaner'
  gem 'test_notifier'
end

group :production do
  gem 'heroku_backup_task'
en

我收到通知,当我进入应用程序时,正在使用错误版本的ruby。但我无法通过运行el capitan的rvm更新此内容:

ruby-1.9.2-p330 is not installed.
To install do: 'rvm install ruby-1.9.2-p330'
Zacharys-MacBook-Pro:start-stop-note zak$ rvm install ruby-1.9.2-p330
Warning! PATH is not properly set up, $GEM_HOME is not set,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-2.2.1'.
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-1.9.2-p330.
It is not possible to build movable binaries for rubies 1.8-1.9.2, but you can do it for your system only.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.

RVM does not know how to build working ruby-1.9.2-p330 on OSX 10.11,
if you know please let us know by opening a ticket with instructions here:

    https://github.com/rvm/rvm/issues

0 个答案:

没有答案