Installing starling on Windows - ruby

I am trying to install the starling gem on my Windows machine. But, whenever I try to install it I get this error:
Building native extensions. This could take a while...
ERROR: Error installing starling:
ERROR: Failed to build gem native extension.
c:/ruby/bin/ruby.exe extconf.rb install starling -- --srcdir= c:\ruby-1.8.7-p72
checking for windows.h... no
*** 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
--srcdir=.
--curdir
--ruby=c:/ruby/bin/ruby
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0
.12.2 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.2/ext/gem_mak
e.out
What do I need to install to provide the windows.h header?

Gems is somewhat broken on Windows at present was at the time broken on Windows, but it's fixed now. The following workaround applies to the old One-Click Installer version of Ruby; you should really update to the new MinGW-based RubyInstaller and the DevKit to which the workaround still works, but is more future proof.
Locate a version of the problem gem (in this case it's eventmachine) that has a win32 binary. If you look on RubyForge, you'll see that the last eventmachine gem to possess a win32 binary is version 0.12.0
Force that version of event machine to install:
$ gem install eventmachine --version=0.12.0
Successfully installed eventmachine-0.12.0-x86-mswin32
1 gem installed
Installing ri documentation for eventmachine-0.12.0-x86-mswin32...
Installing RDoc documentation for eventmachine-0.12.0-x86-mswin32...
Now install try installing your original gem again:
$ gem install starling
Successfully installed ZenTest-3.10.0
Successfully installed memcache-client-1.5.0
Successfully installed SyslogLogger-1.4.0
Successfully installed starling-0.9.8
4 gems installed
Installing ri documentation for ZenTest-3.10.0...
Installing ri documentation for memcache-client-1.5.0...
Installing ri documentation for SyslogLogger-1.4.0...
Installing ri documentation for starling-0.9.8...
Installing RDoc documentation for ZenTest-3.10.0...
Installing RDoc documentation for memcache-client-1.5.0...
Installing RDoc documentation for SyslogLogger-1.4.0...
Installing RDoc documentation for starling-0.9.8...
Be warned though, if you now run gem update gems will stupidly try and install the latest version of eventmachine which, as we already know, won't build on Windows. This causes gem update to stop completely. See this question to find out how to work around this particular annoyance.

The install seems to be stuck on installing the eventmachine gem.
The easiest approach here may be to download and install the eventmachine binary gem for windows here
Otherwise you will need a compiler. (which I assume you don't have)

I don't know if this will work but someone is working on a one click installer of Ruby under Windows that comes with a C compiler.
See http://github.com/luislavena/rubyinstaller/tree/master

Now that everything is installed, is it possible to get it working under windows? I'm getting a fork() function unimplemented on this machine, because, Windows doesn't have a fork() process.

Related

therubyracer installation on windows with libv8 installed --with-system-v8

I finally got libv8 installed on my windows with
gem install libv8 -- --with-system-v8
now when I am trying to install therubyracer I get
gem install therubyracer
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb --with-system-v8
checking for main() in -lpthread... no
checking for v8.h... no
*** 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=C:/Ruby193/bin/ruby
--with-pthreadlib
--without-pthreadlib
--enable-debug
--disable-debug
--with-v8-dir
--without-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/
C:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in `configure': You hav
e chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location
thanks,
The Mgmt
What I want to know is what this error message really means?
Also I looked this up https://github.com/cowboyd/libv8#bring-your-own-v8
How do I install headers for v8?
When I faced this problem I found that I didn't need those gems in development, because rails use to precompile your assets, so my solution was pretty simple,
Gemfile
gem "rails"
group :production do
gem 'therubyracer'
end
Then when you bundle run this command
$ bundle install --without production
Then smile to the life :D
On Mac you can try updating the v8 library with homebrew:
gem uninstall libv8
brew install v8
gem install therubyracer
Update: Sorry, didn't realize this was a Windows only question.
#Aalap
I ran into the same problem while setting up my Ruby on Rails web application on Windows 7 64-bit. I came across this solution. This is a bit old but solved the problem. This solution provides 'therubyracer' gem file and v8.dll libs to install. The instructions are pretty much clear on the link above.
I installed 'libv8' gem just like Periback's answer on SO and when I tried to install 'therubyracer' gem, it failed with same error as yours. Now my web application is running fine and my "gem list" command shows:
libv8 (3.11.8.13)
therubyracer (0.11.0beta1 x86-mingw32)
Hope this helps.

Installing mysql-2.9.0 gem on Windows fails due to lack of libmysql

I'm trying to install Redmine 2.1.4 on Windows Server 2003. For it to work, I need to install activerecord-mysql-adapter gem, which in turn seems to rely on mysql-2.9.0.gem. I've downloaded the latter from rubygems and executed:
gem install mysql-2.9.0.gem
which gives the following output:
C:\>gem install mysql-2.9.0.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing mysql-2.9.0.gem:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for main() in -llibmysql... no
*** 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=C:/Ruby193/bin/ruby
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-libmysqllib
--without-libmysqllib
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql-2.9.0 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql-2.9.0/ext/mysql_api/gem_make.out
I'm guessing, one possibility is I'm lacking MySQL C Connector library. I've downloaded both mysql-connector-c-6.0.2-win32.msi and mysql-connector-c-6.0.2-win32-vs2005.msi from http://dev.mysql.com/downloads/connector/c/, but both installers exited with:
I also tried copying C:\Program Files\MySQL\MySQL Server 5.1\lib\debug\libmysql.dll to C:\Ruby193\bin, but it also didn't solve the mysql-2.9.0.gem installation issue.
What else can I try?
EDIT
From the logs I figured, Ruby was looking for libs under, surprise, surprise, $RUBY_HOME\lib, not $RUBY_HOME\bin, as found in some sources mentioned in the question. So moving the libmysql from $MySQL_HOME\lib to $RUBY_HOME\lib helped a little, but now Ruby cannot find some other libs and headers. So I'm guessing, I need to use the an option like:
C:\>gem install mysql-2.9.0.gem --platform=ruby --with-opt-lib="C:/Program Files/MySQL/MySQL Server 5.1/lib" --with-opt-include="C:/Program Files/MySQL/MySQL Server 5.1/include"
which won't work either (probably because of spaces in path).
Try with no installer version of connector from http://dev.mysql.com/downloads/connector/c/ and extract the content in root folder or a folder path which does not have any space for and then try to install mysql gem
example
gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32
I've released mysql gem version 2.9.0 with both ruby and x86-mingw32 pre-compiled binaries.
If you let RubyGems determine the right platform, it will automatically install x86-mingw32 platform gem for you, which will avoid the compilation process.
Once installed, it will show you a set of instructions indicating you to download MySQL Connector/C and placing it's DLLs in the right place:
C:\Users\Luis>gem install mysql
Fetching: mysql-2.9.0-x86-mingw32.gem (100%)
======================================================================================================
You've installed the binary version of mysql.
It was built using MySQL Connector/C version 6.0.2.
It's recommended to use the exact same version to avoid potential issues.
At the time of building this gem, the necessary DLL files where available
in the following URL:
http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick
You can put the lib\libmysql.dll available in this package to your Ruby bin directory.
E.g. C:\Ruby\bin
======================================================================================================
Successfully installed mysql-2.9.0-x86-mingw32
1 gem installed
There is no need to download or install MySQL if you only need to connect to an already running version of MySQL.
Both RubyGems and Bundler will automatically detect the right platform and install the right pre-compiled binaries without the need to compile them on your own.
If you're behind a proxy, use --http-proxy parameter of gem install (see help) or set HTTP_PROXY environment variable.
Hope that helps.

Can't install ruby-debug, error: rb_method_entry_t.called_id

I'm trying to install ruby-debug. I'm using Mac OS 10.7.4, XCode version 2308, and Ruby version 1.9.3-p194.
Following the instructions here: http://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-ruby-debug, I tried running
sudo gem install ruby-debug
I got the following error:
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.
/Users/andrew/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
*** 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
--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/andrew/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
extconf.rb:16:in `block in <main>': break from proc-closure (LocalJumpError)
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `call'
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `create_makefile_with_core'
from extconf.rb:32:in `<main>'
Gem files will remain installed in /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19-0.11.26 for inspection.
Results logged to /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19-0.11.26/ext/ruby_debug/gem_make.out
So I tried the following command:
sudo gem install debugger
Which resulted in:
Fetching: columnize-0.3.6.gem (100%)
Fetching: debugger-ruby_core_source-1.1.3.gem (100%)
Fetching: debugger-linecache-1.1.1.gem (100%)
Building native extensions. This could take a while...
Fetching: debugger-1.1.4.gem (100%)
Building native extensions. This could take a while...
Successfully installed columnize-0.3.6
Successfully installed debugger-ruby_core_source-1.1.3
Successfully installed debugger-linecache-1.1.1
Successfully installed debugger-1.1.4
4 gems installed
Installing ri documentation for columnize-0.3.6...
Installing ri documentation for debugger-ruby_core_source-1.1.3...
Installing ri documentation for debugger-linecache-1.1.1...
Couldn't find file to include 'VERSION' from lib/linecache19.rb
Installing ri documentation for debugger-1.1.4...
Installing RDoc documentation for columnize-0.3.6...
Installing RDoc documentation for debugger-ruby_core_source-1.1.3...
Installing RDoc documentation for debugger-linecache-1.1.1...
Couldn't find file to include 'VERSION' from lib/linecache19.rb
Installing RDoc documentation for debugger-1.1.4...
So I researched the issue and finally came across this post:
how do I install ruby-debug in ruby 1.9.3 / Rails 3.2.1
Everything worked until I tried the command:
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$SANDBOX/packages/ruby-1.9.3-p194
Which just reproduced the first error, above. So I looked into
rb_method_entry_t.called_id
And found this post: https://github.com/ruby/ruby/pull/56/#issuecomment-3463264
I tried his suggested steps, except for rehash (which I'm not sure how to do with rvm, and didn't want to switch to rbenv just to try it). I downloaded all the gems he recommended to a folder, and ran the following command:
gem install *.gem -- --with-ruby-include=$(echo ~/.rvm/rubies/1.9.3-p194/include/ruby-1.9.1/ruby-1.9.3-p194/) --no-rdoc --no-ri
It installed linecache19-0.5.13 fine, but it choked on ruby-debug-base19-0.11.26.gem, producing the first error again.
I also tried uninstalling the debugger gems added when I ran sudo gem install debugger, but that hasn't changed anything.
I'm at a loss for what to do next.
ruby-debug is broken for ruby 1.9, give "pry" a try, instead. Maybe it is possible to get ruby-debug working but I wouldn't count on it.
Debugging in ruby 1.9
I know this question is rather old but I got the same error today and this the first result when I google the error.
For me debugger was installing as a dependency and running
gem install debugger
before bundle fixed it.
Just ran into this with Ruby 2.0.0 installed via RVM.
RVM will just install with the binaries if they are available, which is faster, but debugger needs the source too
rvm reinstall 2.0.0 --disable-binary

Error installing debugger-linecache in Ruby 1.9.3

I need version 1.0.1 of debugger-linecache for a project, and I am facing the following error when trying to install.
trunk ☺ gem install debugger-linecache -v '1.0.1'
Building native extensions. This could take a while...
ERROR: Error installing debugger-linecache:
ERROR: Failed to build gem native extension.
/Users/jordanscales/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.3-p194 provided with debugger-ruby_core_source gem.
**************************************************************************
*** 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
--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/jordanscales/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
Gem files will remain installed in /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1 for inspection.
Results logged to /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1/ext/trace_nums/gem_make.out
trunk ☺
Any help would be extremely appreciated, I have been searching but cannot find a working solution.
this may help you, it works for me
gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/
This error means that the selected version of debugger does not support your current Ruby version. There are two solutions:
Update the debugger gem via bundle update debugger. New versions of debugger are backward-compatible with old Ruby versions, so this is the best way to fix it.
Downgrade your Ruby version.
Update/Install the gem debugger-ruby_core_source,
gem install debugger-ruby_core_source
it has been corrected here : https://github.com/cldwalker/debugger-ruby_core_source/pull/7
The problem was that I was using gemsets incorrectly. I knew not having permissions were an issue, as under RVM I shouldn't need sudo to install anything.
rvm gemset use global and then a bundle install did the trick.
From the below link:
https://github.com/cldwalker/debugger/issues/50
I have installed gem ruby-debug19 and problem solved for me as below:
$ bundle
... -> failed to build debugger-linecache
$ gem install ruby-debug19
$ bundle
... -> all is fine
In my case problem was not related to debugger-linecache directly. Either try upgrading debugger-ruby_core_source or downgrade Ruby by few patchlevels.
I've executed bundle update debugger-linecache. Although I had its newest version in Gemfile.lock, debugger-ruby_core_source has been upgraded to 1.1.5 and debugger-linecache has stopped complaining.
I installed debugger-ruby_core_source gem, based on perusing old answers here: https://github.com/cldwalker/debugger/issues/12
If you are using rvm, then make sure the path lead to ruby, in rvm its rubies folder
$rvm_path/rubies/ruby-1.9.3-p448
gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/rubies/ruby-1.9.3-p448
Your Gemfile.lock wasn't written with the same Ruby that you're trying to bundle against.
bundle update should work by making Bundler look at different versions.
manually build it. it works for me
https://gist.github.com/4060260

Problems with jslint-v8 Ruby gem installation on Windows7 64-bit

There is a problem during Rally App SDK 2.0p environment setup on Windows 7 (64-bit). I have installed Ruby 1.8.7-p358 from rubyinstaller.org and managed to install rake Ruby gem. But I have problems installing jslint-v8 gem. It has dependencies on therubyracer and libv8 gems which need to be built using Ruby DevKit. During the installation I got the following error:
C:\ruby> gem install jslint-v8
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jslint-v8:
ERROR: Failed to build gem native extension.
C:/ruby/bin/ruby.exe 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=C:/ruby/bin/ruby
extconf.rb:13: uninitialized constant Gem (NameError)
Checking for Python...
Gem files will remain installed in C:/ruby/lib/ruby/gems/1.8/gems/libv8-3.3.10.4 for inspection.
Results logged to C:/ruby/lib/ruby/gems/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out
Does anyone know how to install it correctly in Win7?
Thank you!
The gem you try to install depends on libv8 gem, which is nothing more than a wrapper for Google V8 JavaScript VM.
There is no pre-compiled libv8 for Windows (like there is for Linux or OSX), this means it needs to build V8 from scratch.
The code around the build process of V8 is not very portable, not to mention that to compile libv8 you need Python installed :-P
Until today nobody was able to follow the instructions for libv8 pre-compilation on Windows, following the repository instructions:
https://github.com/cowboyd/libv8
Sorry not been able to provide you a better response.
Try this gem install libv8 -v '3.16.14.3' -- --with-system-v8
Reference: Error installing libv8: ERROR: Failed to build gem native extension
For building gem native extensions in Windows when you install a gem, you usually need the DevKit installed too:
http://rubyinstaller.org/downloads/ - go to the devkit download link
Their github page has instructions for installing it: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
I would also recommend using Ruby 1.9.3 instead of 1.8.7, but that shouldn't be much of an issue
Hope that helps.

Resources