Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to build gem native extension: Unable to install Rails + MySQL2
    primarykey
    data
    text
    <p>I am on MAC OS X LION and keep getting error message Failed to build gem native extension when trying to install rails and mysql.</p> <p>This is what I am doing. I enter:</p> <pre><code> $ sudo gem install rails </code></pre> <p><strong>Error message</strong></p> <pre><code>Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.6.5 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/json-1.6.5/ext/json/ext/parser/gem_make.out ingjerd$ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] </code></pre> <p><strong>The same happens when I try to install mysql2 gem.</strong> </p> <p>When I do the command </p> <pre><code> gem list </code></pre> <p>Then rails and mysql is not in that list of local gems.</p> <p>When I try the command </p> <pre><code> which rails </code></pre> <p>I get: </p> <pre><code>/usr/bin/rails </code></pre> <p>So then that kind of makes me think that rails is in there somewhere. But when I try:</p> <pre><code> $ rails -v </code></pre> <p>I get:</p> <pre><code>Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install rails You can then rerun your "rails" command. </code></pre> <p><strong>I wonder whether this happens because I did things in the wrong order?</strong></p> <p>I first updated gems and then I installed XCODE and changed the .bash_profile to the following - and I think I should have done this before updating gems. </p> <pre><code>PS1="\u$ " alias ll="ls -laGH" export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" </code></pre> <p>I think I should have done the .bash_profile path before updating gems and I should also have installed xcode first, but I was unsure of the order of doing things.</p> <p>Please help a true newbie to ruby as I can't start learning before I have a working environment....</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload