ruby-on-rails - 在 Ubuntu 上更新 RubyGems

标签 ruby-on-rails ubuntu rubygems

有谁知道如何在 Ubuntu 上更新 RubyGems。通常的方法不起作用:

steve@ubuntu:~$ rails /home/steve/www/mynewapp -d mysql
      create  
      create  app/controllers
      create  app/helpers
      create  app/models
      create  app/views/layouts
      create  config/environments
      create  config/initializers
      create  config/locales
      create  db
      create  doc
      create  lib
      create  lib/tasks
      create  log
      create  public/images
      create  public/javascripts
      create  public/stylesheets
      create  script/performance
      create  test/fixtures
      create  test/functional
      create  test/integration
      create  test/performance
      create  test/unit
      create  vendor
      create  vendor/plugins
      create  tmp/sessions
      create  tmp/sockets
      create  tmp/cache
      create  tmp/pids
      create  Rakefile
      create  README
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  config/database.yml
      create  config/routes.rb
      create  config/locales/en.yml
      create  db/seeds.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/new_rails_defaults.rb
      create  config/initializers/session_store.rb
      create  config/environment.rb
      create  config/boot.rb
      create  config/environments/production.rb
      create  config/environments/development.rb
      create  config/environments/test.rb
      create  script/about
      create  script/console
      create  script/dbconsole
      create  script/destroy
      create  script/generate
      create  script/runner
      create  script/server
      create  script/plugin
      create  script/performance/benchmarker
      create  script/performance/profiler
      create  test/test_helper.rb
      create  test/performance/browsing_test.rb
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/index.html
      create  public/favicon.ico
      create  public/robots.txt
      create  public/images/rails.png
      create  public/javascripts/prototype.js
      create  public/javascripts/effects.js
      create  public/javascripts/dragdrop.js
      create  public/javascripts/controls.js
      create  public/javascripts/application.js
      create  doc/README_FOR_APP
      create  log/server.log
      create  log/production.log
      create  log/development.log
      create  log/test.log
steve@ubuntu:~$ cd /home/steve/www/mynewapp
steve@ubuntu:~/www/mynewapp$ ruby script/server
Rails requires RubyGems >= 1.3.2 (you have 1.3.1). Please `gem update --system` and try again.
steve@ubuntu:~/www/mynewapp$ gem update --system
ERROR:  While executing gem ... (RuntimeError)
    gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.

最佳答案

您似乎是从 Debian/apt-get 软件包安装了 ruby​​gems。

如果您使用的是 Ubuntu 9.04 或更高版本,这可能有效:

sudo gem install rubygems-update
sudo update_rubygems

否则,删除软件包并从源代码安装 ruby​​gems,这是安装 ruby​​gems 的推荐方法:

sudo apt-get remove rubygems
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar xzvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update --system

更多资源:Ruby on Rails installation on Ubuntu .

关于ruby-on-rails - 在 Ubuntu 上更新 RubyGems,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1814301/

相关文章:

ruby-on-rails - ActiveAdmin 操作

javascript - 如何根据在rails简单表单中选中的单选按钮渲染输入表单

ubuntu - 无法解析 kubernetes.default 或服务

ruby-on-rails - 通过使用带有 poltergeist 的 Rails 获取页面源代码

ubuntu - 使用 Ubuntu 16.04 下载 GHDL

ubuntu - XDebug 无法打开远程调试文件 '/var/log/xdebug/xdebug.log'?

ruby - Roo Gem 检查空工作表

ruby-on-rails - 架构arm64构建nokogiri-xmlsec-instruct的 undefined symbol Ruby gem

ruby-on-rails - 将数据从 CSV 导入到 PSQL

css - 每行四个产品 Bootstrap/ROR 停止使用添加的信息?