rails 4.2 上的 Firebird 2.5 和 ruby

Firebird 2.5 and ruby on rails 4.2

我正在尝试使用 active-fb-record,但遇到了问题。你能帮助我吗?我正在使用 Rails 4.2.2 和 Ruby 2.1.6(32 位版本 ruby 安装程序)

我安装了 gem active-fb-record 和 fb,我没有遇到任何问题。问题始于我尝试 运行 命令 rails s。这是我的错误。

    Microsoft Windows [Versión 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.

C:\Users\Steny>gem install activerecord-fb-adapter
Successfully installed activerecord-fb-adapter-1.0.1
Parsing documentation for activerecord-fb-adapter-1.0.1
Done installing documentation for activerecord-fb-adapter after 1 seconds
1 gem installed

C:\Users\Steny>cd Documents\Proyectos

C:\Users\Steny\Documents\Proyectos>rails new firebird_app/RoR
      create
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/views/layouts/application.html.erb
      create  app/assets/images/.keep
      create  app/mailers/.keep
      create  app/models/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/bundle
      create  bin/rails
      create  bin/rake
      create  bin/setup
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/secrets.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/robots.txt
      create  test/fixtures
      create  test/fixtures/.keep
      create  test/controllers
      create  test/controllers/.keep
      create  test/mailers
      create  test/mailers/.keep
      create  test/models
      create  test/models/.keep
      create  test/helpers
      create  test/helpers/.keep
      create  test/integration
      create  test/integration/.keep
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.keep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.keep
         run  bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.............................................
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.7.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.2
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.6
Using loofah 2.0.2
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.2
Using rack 1.6.4
Using rack-test 0.6.3
Using actionpack 4.2.2
Using globalid 0.3.5
Using activejob 4.2.2
Using mime-types 2.6.1
Using mail 2.6.3
Using actionmailer 4.2.2
Using activemodel 4.2.2
Using arel 6.0.0
Using activerecord 4.2.2
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using bundler 1.10.4
Using columnize 0.9.0
Using byebug 5.0.0
Using coffee-script-source 1.9.1.1
Using execjs 2.5.2
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.2
Using coffee-rails 4.1.0
Using multi_json 1.11.1
Using jbuilder 2.3.0
Using jquery-rails 4.0.4
Using sprockets 3.2.0
Using sprockets-rails 2.3.2
Using rails 4.2.2
Using rdoc 4.2.0
Using sass 3.4.15
Using tilt 1.4.1
Using sass-rails 5.0.3
Using sdoc 0.4.1
Using sqlite3 1.3.10
Using turbolinks 2.5.3
Using tzinfo-data 1.2015.5
Using uglifier 2.7.1
Using web-console 2.1.3
Bundle complete! 12 Gemfile dependencies, 54 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

C:\Users\Steny\Documents\Proyectos>DIR
 El volumen de la unidad C no tiene etiqueta.
 El número de serie del volumen es: 5464-39C3

 Directorio de C:\Users\Steny\Documents\Proyectos

24/06/2015  23:18    <DIR>          .
24/06/2015  23:18    <DIR>          ..
24/06/2015  23:18    <DIR>          firebird_app
               0 archivos              0 bytes
               3 dirs  265.474.629.632 bytes libres

C:\Users\Steny\Documents\Proyectos>cd firebird_app

C:\Users\Steny\Documents\Proyectos\firebird_app>cd RoR

C:\Users\Steny\Documents\Proyectos\firebird_app\RoR>bundle update
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies..............................................
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.7.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.2
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.6
Using loofah 2.0.2
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.2
Using rack 1.6.4
Using rack-test 0.6.3
Using actionpack 4.2.2
Using globalid 0.3.5
Using activejob 4.2.2
Using mime-types 2.6.1
Using mail 2.6.3
Using actionmailer 4.2.2
Using activemodel 4.2.2
Using arel 6.0.0
Using activerecord 4.2.2
Using fb 0.7.4
Using activerecord-fb-adapter 1.0.1
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using bundler 1.10.4
Using columnize 0.9.0
Using byebug 5.0.0
Using coffee-script-source 1.9.1.1
Using execjs 2.5.2
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.2
Using coffee-rails 4.1.0
Using multi_json 1.11.1
Using jbuilder 2.3.0
Using jquery-rails 4.0.4
Using sprockets 3.2.0
Using sprockets-rails 2.3.2
Using rails 4.2.2
Using rdoc 4.2.0
Using sass 3.4.15
Using tilt 1.4.1
Using sass-rails 5.0.3
Using sdoc 0.4.1
Using sqlite3 1.3.10
Using turbolinks 2.5.3
Using tzinfo-data 1.2015.5
Using uglifier 2.7.1
Using web-console 2.1.3
Bundle updated!

C:\Users\Steny\Documents\Proyectos\firebird_app\RoR>rails generate scaffold Client name:string address:string email:string remar:text
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activerecord-fb-adapter-1.0.1/lib/active_record/connection_adapters/fb_adapter.rb:6:in `require': 126: No se puede encontrar el módulo especificado.   - C:/Ruby2
1-x64/lib/ruby/gems/2.1.0/gems/fb-0.7.4/fb.so (LoadError)
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activerecord-fb-adapter-1.0.1/lib/active_record/connection_adapters/fb_adapter.rb:6:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activerecord-fb-adapter-1.0.1/lib/activerecord-fb-adapter.rb:1:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activerecord-fb-adapter-1.0.1/lib/activerecord-fb-adapter.rb:1:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:76:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:72:in `each'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:72:in `block in require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:61:in `each'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:61:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.10.4/lib/bundler.rb:134:in `require'
        from C:/Users/Steny/Documents/Proyectos/firebird_app/RoR/config/application.rb:7:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:141:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:50:in `generate'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

C:\Users\Steny\Documents\Proyectos\firebird_app\RoR>rails -v
Rails 4.2.2

C:\Users\Steny\Documents\Proyectos\firebird_app\RoR>ruby -v
ruby 2.1.6p336 (2015-04-13 revision 50298) [x64-mingw32]

C:\Users\Steny\Documents\Proyectos\firebird_app\RoR>

我在 rails 上使用 ruby 在 Windows 7

您需要安装 firebird 32 位版本,以匹配 mingw/ruby 与相同位 (32/64)

请安装 firebird 2.5.4 x32 并复制到系统目录(选中) 来自 http://www.firebirdsql.org/en/firebird-2-5/

然后安装rubyinstaller(默认为32位) 安装 Devkit DevKit-mingw64-32

解压到C:\rubydevkit 在开始->运行

中打开cmd.exe
cd rubydevkit 

运行

ruby dk.rb init 

ruby dk.rb install 

将其绑定到您路径中的 ruby 个安装。

然后

gem install fb

并且 activerecord-fb-adapter 将在编译后正常工作(也加载它)