How to install ruby ​​interface for sqlite3 in Mac Snow leopard?

I tried to install it as shown below, but it throws an error: -

"sudo gem install sqlite3-ruby" Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: 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/sqlite3-ruby-1.3.1 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out 

Some information about my system: -

ruby -v 1.8.7
rails -v 3.0.1
gem -v 1.3.7
sqlite3 - version 3.6.12

Also, how can I check if the ruby ​​interface for sqlite3 is installed on my system?
Like us, "rails-v", to check if rails are installed in our system. I did not find any commands on the network to check if the ruby ​​interface for sqlite3 is installed on my system?

+1
source share
2 answers

To compile native code in OS X (for example, this is a native Ruby extension), you must install Apple Xcode.

Xcode includes various developer tools, such as the clang compiler and development header files ( ruby.h among others).

The latest version of Xcode is available on the App Store. Although by default Xcode no longer installs developer tools in such a way as to make them accessible from the shell, you can fix this by installing the "Command Line Tools" on the "Download" tab of the Xcode IDE Preferences window.

See this answer for more details.

+2
source

Source: https://habr.com/ru/post/1312623/


All Articles