gpt4 book ai didi

ruby-on-rails - 为什么 `gem install rails` 会失败?

转载 作者:IT王子 更新时间:2023-10-29 00:26:22 25 4
gpt4 key购买 nike

作为背景,这是我的环境:

vishal@dishDell:~$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.9.1
- /home/vishal/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

这是我尝试运行 gem install rails 时发生的情况。

vishal@dishDell:~$ sudo gem install rails
[sudo] password for vishal:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'


Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/json-1.7.3 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/json-1.7.3/ext/json/ext/parser/gem_make.out

我使用 apt-get 安装了 Ruby 1.9.3,并从 ruby​​gems.org 的 tarball 安装了 RubyGems。我应该怎么做才能让它发挥作用?

最佳答案

这对我适用于 Ubuntu 12.10:

sudo apt-get install ruby
sudo apt-get install ruby-dev
sudo apt-get install rubygems
sudo gem install rails

关于ruby-on-rails - 为什么 `gem install rails` 会失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11481097/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com