2016-07-25 25 views
4

无法使用jruby启动rails5,出现以下错误。 JRUBY的Rails5 jruby无法启动

[email protected]  ~/Development/rails5app  rails s 
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original  method using super. (called from require at bin/rails:4) 
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcmysql-adapter'. 
Gem Load Error is: uninitialized constant ActiveRecord::ConnectionAdapters::Column::Format 
Backtrace for gem load error is: 
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:13:in `<module:TypeCast>' 
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:7:in `<module:Jdbc>' 
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:4:in `< module:ConnectionAdapters>' 
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:3:in `<top>' 
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:1:in `singleton cla 

版本和Rails

  • jruby的9.1.2.0(2.3.0)2016年5月26日7357c8f
  • OpenJDK的64位服务器
  • VM 25.91-B14 on 1.8.0_91-8u91-b14-0ubuntu4〜16.04.1-b14 + jit [linux-x86_64]
  • Rails 5.0.0

回答

6

ActiveRecord的JDBC宝石一直没有更新为Rails 5.检查在GitHub上的项目显示,今年年初一些开发活动,但在新的宝石将被释放的Rails 5

4

添加gem 'activerecord-jdbcmysql-adapter', '~> 5.0.pre1'没有指示你的宝石文件