2
Saads-Mac-Pro:~ SMD$ gem install rails
Building native extensions.  This could take a while...
/Users/SMD/.rvm/rubies/ruby-2.0.0- p247/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:54: warning: Insecure world writable dir /usr in PATH, mode 040777
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

/Users/SMD/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/SMD/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
/Users/SMD/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The  compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/SMD/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from /Users/SMD/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:817:in `try_run'
from extconf.rb:24:in `<main>'


Gem files will remain installed in /Users/SMD/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.13 for inspection.
Results logged to /Users/SMD/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.13/ext/gem_make.out

これは、このコマンドを実行したときの出力gem install railsです。私は何を間違っていますか?前もって感謝します

編集:

の出力gem env:

Saads-Mac-Pro:~ SMD$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.7
  - RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin12.3.0]
  - INSTALLATION DIRECTORY: /Users/SMD/.rvm/gems/ruby-2.0.0-p247
  - RUBY EXECUTABLE: /Users/SMD/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/SMD/.rvm/gems/ruby-2.0.0-p247/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-12
  - GEM PATHS:
     - /Users/SMD/.rvm/gems/ruby-2.0.0-p247
     - /Users/SMD/.rvm/gems/ruby-2.0.0-p247@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
4

5 に答える 5

2

これが私を助けた答えです:Ruby on Rails - xxx/xxxx/xxxx の "\x89" を ASCII-8BIT から UTF-8 に変換できません

変換をサポートするバージョンの rdoc gem を更新またはインストールする必要があります。そうすれば、レールをインストールするとき、またはドキュメントを再生成するときに、ドキュメントの生成中にこれらのエラーは表示されません。

gem install rdoc

次に、ドキュメントを再生成します

gem rdoc --all --overwrite

それから行いgem updateますgem install rails

また、 rvm が関数であることを確認してくださいtype rvm | head -1

于 2013-11-07T13:51:16.057 に答える
1

エラーを調べてください:--

`Gem ファイルは /Users/SMD/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.13 にインストールされたままになります

検査用. so it is for gem name asatomic and you requiredjava jdk 8 github.com/headius/ruby-atomic last line stated as of1.1.0 ,JDK8は、新しいatomic`を使用しようとするため、atomic gemを構築するために必要です。

JDK8をインストールしてください

于 2013-08-27T11:28:22.403 に答える
1
Parsing documentation for rails-4.0.0
unable to convert "\x89" from ASCII-8BIT to UTF-8 for guides/assets/images/belongs_to.png, skipping
unable to convert "\xF4" from ASCII-8BIT to UTF-8 for guides/assets/images/book_icon.gif, skipping

これは rdoc gem の問題です。この問題は github で見つけることができます。rdoc gem を更新し、レールを再インストールします。

$ gem install rdoc
$ gem install rails
于 2013-10-17T17:51:12.297 に答える