【问题标题】:Rails postgres wrong ELF class: ELFCLASS32Rails postgres错误的ELF类:ELFCLASS32
【发布时间】:2013-09-05 23:33:34
【问题描述】:

我使用的是 rails 3.2.13、ruby 2.0 和 Ubuntu 13.04 64 位。

Bundler 提醒我使用 bundle install --no-deployment 并且每当我运行 rails 服务器时我就开始得到它

/home/vincent/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.15.1/lib/pg.rb:4:in `require': /home/vincent/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.15.1/lib/pg_ext.so: wrong ELF class: ELFCLASS32 - /home/vincent/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.15.1/lib/pg_ext.so (LoadError)

这可能与我使用 64 位操作系统有关,但它可以正常工作。

【问题讨论】:

    标签: ruby-on-rails ruby postgresql ubuntu elf


    【解决方案1】:

    在 gem 文件中创建组之前,我也遇到过同样的问题。

    我需要查看您的 Gemfile 来确定,

    但我猜你只需要为测试、开发和生产组。

    group :production do
      gem 'pg', '0.15.1'
      gem 'rails_12factor', '0.0.2'
    end
    
    group :development do
      gem "bullet"
      gem "pry-rails"
      gem 'newrelic_rpm'
    end
    
    # Use sqlite3 as the database for Active Record
    group :development, :test do
      gem 'debugger'
      gem 'sqlite3'
    end
    

    完成分组设置后,您可以使用类似的命令

    bundle install --development
    
    or
    
    bundle install --without production
    

    【讨论】:

      【解决方案2】:

      对我有用的解决方案就是这样做

      bundle install --deployment
      

      它开始工作了。

      【讨论】:

        猜你喜欢
        • 2011-09-04
        • 1970-01-01
        • 2022-08-17
        • 1970-01-01
        • 2011-05-09
        • 1970-01-01
        • 1970-01-01
        • 2013-04-17
        • 1970-01-01
        相关资源
        最近更新 更多