JRuby 1.6.3 升级到 Rails 3.1 导致迁移中断

发布于 2024-11-26 14:18:33 字数 1401 浏览 1 评论 0原文

我最近升级了 gemfile,尝试让 Rails 3.1 与 Jruby 3.1 一起工作。

这是我的 Gemfile:

来源 'http://rubygems.org' source 'http://gems.engineyard.com'

gem 'rails',               '~> 3.1.0.rc4'
gem 'sass-rails'
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
gem 'fancy-buttons'
gem 'haml'
gem 'authlogic', :git => 'https://github.com/AndreasWurm/authlogic.git'#, :branch => 'rails3'
gem 'nokogiri'
gem 'bundler'
gem 'resque'              
gem 'resque-meta'        
gem 'jquery-rails'     
gem 'rake'#, '~> 0.8.7'          
gem 'eventmachine'
gem 'em-websocket'
gem 'json'
gem 'coffee-script'
gem 'uglifier'

platforms :jruby do
    gem 'activerecord-jdbc-adapter'
    gem 'activerecord-jdbcsqlite3-adapter'
    gem 'jruby-openssl'
    gem 'jdbc-mysql'
    gem 'jruby-rack'
    gem 'warbler'
    #gem 'glassfish', '1.0.3.dev'
end

group :test, :development do
  platforms :jruby do
    gem 'jdbc-sqlite3', :require => false
    gem 'fastercsv'
    gem 'ruby-debug'
  end

  platforms :ruby do
    gem 'sqlite3-ruby', :require => 'sqlite3'
  end

  gem 'mocha'
  gem 'factory_girl'
  gem 'fakeweb'
  gem 'shoulda', :require => 'shoulda'
end

问题是,当我运行 rake db:migrate 时,收到以下错误消息:

耙子中止!本次迁移以及以后的所有迁移均发生错误 取消:

nil:NilClass 的未定义方法“rows”

有其他人经历过这种情况吗?

I have recently upgraded my gemfile to try and get Rails 3.1 working with Jruby 3.1.

Here is my Gemfile:

source 'http://rubygems.org'
source 'http://gems.engineyard.com'

gem 'rails',               '~> 3.1.0.rc4'
gem 'sass-rails'
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
gem 'fancy-buttons'
gem 'haml'
gem 'authlogic', :git => 'https://github.com/AndreasWurm/authlogic.git'#, :branch => 'rails3'
gem 'nokogiri'
gem 'bundler'
gem 'resque'              
gem 'resque-meta'        
gem 'jquery-rails'     
gem 'rake'#, '~> 0.8.7'          
gem 'eventmachine'
gem 'em-websocket'
gem 'json'
gem 'coffee-script'
gem 'uglifier'

platforms :jruby do
    gem 'activerecord-jdbc-adapter'
    gem 'activerecord-jdbcsqlite3-adapter'
    gem 'jruby-openssl'
    gem 'jdbc-mysql'
    gem 'jruby-rack'
    gem 'warbler'
    #gem 'glassfish', '1.0.3.dev'
end

group :test, :development do
  platforms :jruby do
    gem 'jdbc-sqlite3', :require => false
    gem 'fastercsv'
    gem 'ruby-debug'
  end

  platforms :ruby do
    gem 'sqlite3-ruby', :require => 'sqlite3'
  end

  gem 'mocha'
  gem 'factory_girl'
  gem 'fakeweb'
  gem 'shoulda', :require => 'shoulda'
end

The problem is that when I run rake db:migrate, I get the following error message:

rake aborted! An error has occurred, this and all later migrations
canceled:

undefined method `rows' for nil:NilClass

Has anyone else experienced this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

唯憾梦倾城 2024-12-03 14:18:33

升级到 Rails 5 使我能够从 jruby 1.6.3 进行迁移:

source 'http://rubygems.org'
来源“http://gems.engineyard.com”

gem 'rails',               '~> 3.1.0.rc5'
gem 'sass-rails'
gem 'compass', git: 'https://github.com/chriseppstein/compass.git',branch: 'rails31'
gem 'fancy-buttons'
gem 'haml'
gem 'authlogic', :git => 'https://github.com/AndreasWurm/authlogic.git'#, :branch => 'rails3'
gem 'nokogiri'
gem 'bundler'
gem 'resque'              
gem 'resque-meta'        
gem 'jquery-rails'     
gem 'rake'#, '~> 0.8.7'          
gem 'eventmachine'
gem 'em-websocket'
gem 'json'
gem 'coffee-script'
gem 'uglifier'

platforms :jruby do
    gem 'activerecord-jdbc-adapter'
    gem 'activerecord-jdbcsqlite3-adapter'
    gem 'jruby-openssl'
    gem 'jdbc-mysql'
    gem 'jruby-rack'
    gem 'warbler'
    #gem 'glassfish', '1.0.3.dev'
end

Upgrading to rails 5 enabled my migrations to build from jruby 1.6.3 anyway:

source 'http://rubygems.org'
source 'http://gems.engineyard.com'

gem 'rails',               '~> 3.1.0.rc5'
gem 'sass-rails'
gem 'compass', git: 'https://github.com/chriseppstein/compass.git',branch: 'rails31'
gem 'fancy-buttons'
gem 'haml'
gem 'authlogic', :git => 'https://github.com/AndreasWurm/authlogic.git'#, :branch => 'rails3'
gem 'nokogiri'
gem 'bundler'
gem 'resque'              
gem 'resque-meta'        
gem 'jquery-rails'     
gem 'rake'#, '~> 0.8.7'          
gem 'eventmachine'
gem 'em-websocket'
gem 'json'
gem 'coffee-script'
gem 'uglifier'

platforms :jruby do
    gem 'activerecord-jdbc-adapter'
    gem 'activerecord-jdbcsqlite3-adapter'
    gem 'jruby-openssl'
    gem 'jdbc-mysql'
    gem 'jruby-rack'
    gem 'warbler'
    #gem 'glassfish', '1.0.3.dev'
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文