问题
I am trying to install Dashing Framework on my Macbook Air Os X Mavericks running Ruby 2.0.0.
When I run sudo gem install dashing
I get the following errors:
ERROR: Error installing dashing:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/eventmachine-1.0.3 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/eventmachine-1.0.3/ext/gem_make.out
Any thoughts on this? I'm not sure how to get this to install properly..
回答1:
I installed Dashing on a fresh Mavericks install today. I would recommend using Ruby 1.9.3. as per the "Getting Started" section.
Here is what I did:
If you haven't upgraded Xcode yet you should do so, open the terminal and type:
xcode-select --install
This will install xcode command tools.
Install RVM (development version):
\curl -sSL https://get.rvm.io | bash
Watch the output, you have to perform one more step:
source --your path--.rvm/scripts/rvm
Install Ruby 193
rvm install ruby-1.9.3 --with-gcc=clang
I ran with --with-gcc=clang to get around "error: C compiler cannot create executables"
Once installed, you may then use it by executing the following command:
rvm use 1.9.3
And confirm it is in use
ruby -v
Then as per Dashing docs:
gem install dashing
dashing new sweet_dashboard_project
or what you want to name it
Change your directory to sweet_dashboard_project and bundle gems
bundle
dashing start
Browse localhost:3030
回答2:
You need install ruby development package in mac os
see related question
- Unable to install gem - Failed to build gem native extension - cannot load such file -- mkmf (LoadError)
- OS-X, Rails: "Failed to build gem native extension"
回答3:
try the below command and run sudo gem install dashing
yum -y install gcc mysql-devel ruby-devel rubygems
来源:https://stackoverflow.com/questions/22820033/installing-dashing-error