Ruby on rails Rails postgres错误的ELF类:ELFCLASS32

Ruby on rails Rails postgres错误的ELF类:ELFCLASS32,ruby-on-rails,ruby,postgresql,ubuntu,elf,Ruby On Rails,Ruby,Postgresql,Ubuntu,Elf,我使用的是rails 3.2.13、ruby 2.0和Ubuntu 13.04 64位 Bundler唠叨着让我使用bundle安装——没有部署,每当我运行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/ge

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

Bundler唠叨着让我使用bundle安装——没有部署,每当我运行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位操作系统有关,但它只是在工作。

对我有效的解决方案是

bundle install --deployment

它开始工作了

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

我需要看看你的档案才能确定

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

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