When I run command: gem bundle install 'twitter-bootstrap-rails' the result is:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.1 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.1/ext/v8/gem_make.out
An error occured while installing therubyracer (0.10.1), and Bundler cannot continue
Who can tell me what wrong?
That one doesn't work on windows. There is a 'static branch' of (twitter-bootstrap-rails) if I recall correctly that does, but it will cause you lots of headaches. Rails performance on windows is extremely poor anyway, so I recommend you find a linux host.
Related
I'm fairly new to rails. This may be a dumb question, but I can't seem to find a solution. Any suggestion is greatly appreciated.
I've just cloned a repository and I'm running "bundle install". I initially received a general error message regarding "rb-fsevent"when I ran "bundle install". I then just tried to install "rb-fsevent" individually, but received the following error message: (unfortunately I don't have enough reputation to post images...)
An error occurred while installing rb-fsevent (0.4.3.1), and Bundler cannot continue.
Make sure that gem install rb-fsevent -v '0.4.3.1' succeeds before bundling.
dhcp-50-74:sample_app SJ$ gem install rb-fsevent -v '0.4.3.1'
Building native extensions. This could take a while...
ERROR: Error installing rb-fsevent:
ERROR: Failed to build gem native extension.
/Users/SJ/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
creating Makefile
extconf.rb:21:in `': Only Darwin systems greater than 8 (Mac OS X 10.5+) are supported (RuntimeError)
extconf failed, exit code 1
The error message seems to suggest my Mac system is not 10.5+, however, I'm using a MacbookPro running Mavericks OS X 10.9.2.
First of all, read about fsevents here to know what it actually does.
The gem you're trying to install depends on native OSX libraries and you don't seem to be able to build 'em. Try installing command line tools for OSX and install the gem again.
Here's a good tutorial on how to install command line tools:
UPDATE
This was raised as an issue and the fix is to uninstall the previous version and install version 0.9.
gem install 'rb-fsevent' -v '0.9'
or update the gem dependency in your Gemfile:
gem 'rb-fsevent', '>= 0.9'
when i try to run a bundle install on a catarse project on my VPS, many of the gems needed for this project returns errors and i can't install (i'm using: ruby 1.9.2p320).
for example the gems thats return error are:
thin
eventmachine
linecache19
the error is always something that begins with:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
and ends with:
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.2-p320#catarse/gems/linecache19-0.5.12 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.2-p320#catarse/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
can you help to figure out?
Some gems need to be built locally rather than simply downloaded. This means that some of the code in the gem is written in something other than ruby (usually C). The non-ruby code needs to be compiled and built locally in order to run. In those cases you'll need an environment that is capable of compiling and building that non-ruby code.
There's a good post about native gems here : http://patshaughnessy.net/2011/10/31/dont-be-terrified-of-building-native-extensions.
In cases like these it is usually question of tracking down which libraries need to be installed locally in order to build the gem.
I am aware of some issues with linecache19 and there are questions out there that address these, for example : Installing linecache19 for Ruby 1.9.2 via rvm.
I am new to ruby on rails, I am trying to get my first project working with git and heroku. I am following the tutorial by Michael Hartl. I was originally trying to
git push heroku master
but I dont have a GemFile.lock, so I have been trying bundle installs and bundle updates but nothing works because I dont have the json native gem.
bundle update
this is the command that reuturned this error, its not the whole error i left out all the gems i already have
Installing json (1.7.3) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
"C:/Program Files/ruby-1.9.3/bin/ruby.exe" extconf.rb
creating Makefile
make
Makefile:160: warning: overriding commands for target `C:/Program'
Makefile:153: warning: ignoring old commands for target `C:/Program'
C:/Program Files/ruby-1.9.3/bin/ruby -e "puts 'EXPORTS', 'Init_parser'" > parser-i386
mingw32.def
/bin/sh: C:/Program: No such file or directory
make: *** [parser-i386-mingw32.def] Error 127
Gem files will remain installed in C:/Program Files/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/json-1.7.3 f
or inspection.
Results logged to C:/Program Files/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/json-1.7.3/ext/json/ext/parser/gem_make.out
An error occured while installing json (1.7.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.3'` succeeds before bundling.
If anybody knows how to fix my error so that i can move onto the next one or how i can get a working GemFile.lock, it would be appreciated.
Install json_pure instead on your development machine. This is a version of the json gem that does not require C-extensions (but is a bit slower).
On Heroku you should be able to go with the faster json directly.
If you want to build the C-extension on windows then you might want to look here:
The 'json' native gem requires installed build tools
You can create a windows-specific section in the Gemfile like so:
# Common gems
gem 'xyz'
...
# Platform specific gems
platforms :ruby do
gem 'json'
end
platforms :mswin, :mingw do
gem 'json_pure'
end
Windows isn't properly escaping the space in "C:\Program Files". I haven't used Windows in a while, but a quick search reveals a few fixes.
I had the same problem and found that in my config.yaml file, there was an installation of Ruby 1.9.2 that had a space in it. I had to uninstall that version of Ruby entirely, and remove it from the PATH in environment variables. Then, I re-installed the DevKit and it worked perfectly.
When I try to run my application within rubyMine I get an error about capybara-webkit -
...
in `block in materialize':
Could not find capybara-webkit-0.9.0 in any of the sources (Bundler::GemNotFound)
But I don't get it when running the app via the command line.
Seems like rubyMine is checking all environments even when I run development and it has an issue with this gem for some reason.
my Gemfile includes:
...
group :test do
gem 'rspec-rails'
gem "capybara"
gem "capybara-webkit"
...
I am sharing a code base with another developer.
I use rubyMine, he doesn't.
We need capybara-webkit or similar for rspec tests.
Note:
Rails 3.1.3
Ruby 1.9.2-p290
I tried manually installing the gem from within rubyMine, gem manager, but still got error:
Following gems were not installed:
capybara-webkit (0.9.0): Error installing capybara-webkit:
ERROR: Failed to build gem native extension. /Users/durrantm/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb Gem files will remain installed in /Users/durrantm/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0 for inspection. Results logged to /Users/durrantm/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/./gem_make.out
If you're using Mac OS X, then you need to make sure that you have installed all dependencies prior to installing Capybara WebKit. Please see the https://github.com/thoughtbot/capybara-webkit. Thus, you'll need to install Qt 4 Mac and you can get installation instructions here:
http://doc.qt.nokia.com/4.7-snapshot/install-mac.html
Also, you can install it through MacPorts by doing 'sudo port install qt4-mac'. Then you can install the capybara-webkit Ruby gem.
I'm using Ruby on rails (RubyMine) and I try starting my project.
Which tells me the error "Could not find gem 'mysql2 (~> 0.2.6, runtime)' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)".
I've done sudo gem install mysql which gives me
"Error installing mysql:
ERROR: Failed to build gem native extension.
Gem files will remain installed in /var/lib/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
"
What should I do?
You're probably missing the development headers for MySQL. Often this is shipped as an optional package to install. You may need to install mysql-dev or mysql-devel depending on your package manager.
You might also be missing a compiler, so check that you have the required dependencies for gem such as make and gcc.
You might be missing the Ruby development headers as well. On my Ubuntu 11.04 box I have the following aptitude package which is needed for native gem compilation:
ruby1.9.1-dev