I'm trying to upgrade my Redmine installation to the latest.
I updated ruby, rails, and gem as required.
current trunk | ruby 1.8.7, 1.9.2, 1.9.3, jruby-1.6.7 | Rails 3.2.6 | RubyGems <= 1.8
Issuing the rake db:migrate command it gives me the following error:
C:\ruby-apps\RedMine>rake db:migrate RAILS_ENV=production
←[31mCould not find gem 'rmagick (>= 2.0.0) x86-mingw32' in the gems available on this machine.←[0m
←[33mRun bundle install to install missing gems.←[0m
So I installed rmagick for win32 and listing installed gems I see :
...
railties (3.2.6)
rake (0.9.2.2)
rdoc (3.12)
rmagick (2.12.0 mswin32)
ruby-openid (2.1.8)
rubygems-update (1.8.24)
...
But rake db:migrate still give me the same error, so I tried bundle install, but I get:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... * 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.
Any ideas on how to get out of this?
I ran into the same problem while installing redmine. According to a comment in the Gemfile rmagick optional and only used to export Gant graphs as PNGs. So if you do not need this specific feature you can run
bundle install --without development test rmagick
Actually Bitnami's Redmine windows Installer contains a solution to this problem.
Using it, for me is a valid solution to the problem.
The content of the installation may be used to inspect correct versions and dependencies to correctly build Redmine.
Related
Using rbenv for a Ruby 2.3.0 environment on OS X 10.11.1 I am unable to get therubyracer Gem to install when using 'bundle'.
This is successful:
> gem install therubyracer
Building native extensions. This could take a while...
Successfully installed therubyracer-0.12.2
Parsing documentation for therubyracer-0.12.2
Done installing documentation for therubyracer after 0 seconds
1 gem installed
In my Gemfile:
gem 'therubyracer', '0.12.2', platforms: :ruby
This fails:
> bundle
Installing therubyracer 0.12.2 (was 0.12.1) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/jsidlosky/code/sentons/websocket-rails-demo/.bundle/gems/therubyracer-0.12.2/ext/v8
/Users/jsidlosky/.rbenv/versions/2.3.0/bin/ruby -r ./siteconf20160215-9105-1s1s0pv.rb extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
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.
....
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/jsidlosky/code/sentons/websocket-rails-demo/.bundle/extensions/x86_64-darwin-15/2.3.0-static/therubyracer-0.12.2/mkmf.log
The mkmf.log file's error is:
conftest.c:3:10: fatal error: 'v8.h' file not found
Some things I've tried:
From: How to install therubyracer gem on 10.10 Yosemite?
git clone https://github.com/cowboyd/libv8.git
cd libv8
bundle install
bundle exec rake clean build binary
gem install pkg/libv8-3.16.14.13.gem
From: Bundle install tries to use cache file
Adding to ~/.bundle/config
BUNDLE_PATH: .bundle
BUNDLE_DISABLE_SHARED_GEMS: "1"
I also tried this:
bundle config build.libv8 --with-system-v8
I've now spent well over 5 hours trying other random ideas from various StackOverflow questions and other sites. So far, nothing gets me a working therubyracer inside "bundle" even though "gem install therubyracer" works just perfectly.
I will be very grateful for any pointers or solutions.
It appears from the comment from: github.com/cowboyd/therubyracer/issues/359
"I wasn't able to get any of the above solutions to work (or rather, everything I could get to work would have required the rest of my team to rebundle). After switching from rbenv to RVM, however, bundle install ran without a hitch."
I tried switching from rbenv to RVM and it worked perfectly. I can now 'bundle' and therubyracer gem installs perfectly.
I have an app on the Heroku Bamboo stack and have been following the instructions here (https://devcenter.heroku.com/articles/cedar-migration) for migrating to the Cedar stack.
My app has an older version of RefineryCMS (1.0.3) and I'm trying to avoid dealing with an upgrade there (for now), and so I've kept Rails at 3.0.9. Still, Ruby 1.8.7 is past EOL, so I needed to upgrade that at least. I specified 1.9.3 in my Gemfile, thus:
source "https://rubygems.org"
ruby "1.9.3"
And then I attempted to bundle install. Here's my output from that attempt:
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Using rake 0.8.7
Installing RedCloth 4.2.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/day/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20151105-14593-x80q4a.rb extconf.rb
checking for main() in -lc... no
creating Makefile
make clean
make
compiling redcloth_attributes.c
ragel/redcloth_attributes.c.rl: In function 'redcloth_attribute_parser':
ragel/redcloth_attributes.c.rl:26:11: error: variable 'act' set but not used [-Werror=unused-but-set-variable]
ragel/redcloth_attributes.c.rl: In function 'redcloth_attributes':
ragel/redcloth_attributes.c.rl:45:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
ragel/redcloth_attributes.c.rl: In function 'redcloth_link_attributes':
ragel/redcloth_attributes.c.rl:54:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
cc1: all warnings being treated as errors
make: *** [redcloth_attributes.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/day/.rvm/gems/ruby-1.9.3-p551/gems/RedCloth-4.2.7 for inspection.
Results logged to /Users/day/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-darwin-14/1.9.1/RedCloth-4.2.7/gem_make.out
An error occurred while installing RedCloth (4.2.7), and Bundler cannot continue.
Make sure that `gem install RedCloth -v '4.2.7'` succeeds before bundling.
Needless to say gem install RedCloth -v '4.2.7' resulted in the same error.
I found this question, Failed to build gem native extension when install RedCloth-4.2.9 install Linux, however, my issue was with RedCloth 4.2.7 (not 4.2.9) and I'm running OSX Yosemite (not Linux). There was an answer there which pertained to OSX Mountain Lion though, and I thought it was worth a try:
rvm --force install 1.9.2
gem install bundle --no-ri --no-rdoc
bundle install
Obviously, I changed 1.9.2 to 1.9.3 for my purposes, and I omitted the --no-ri --no-rdoc flags. Sadly, bundle install continued to fail with the same error.
Continuing my search online, I found this article, Install RedCloth 4.2.7 gem with bundler (using ruby enterprise edition 1.8.7). Not dissuaded by the version mismatch (again, I'm using Ruby 1.9.3, not 1.8.7), I decided to try the advice I found there, to wit:
bundle config build.RedCloth --with-cflags=-w
bundle install
This time, oh joy! it worked! And I'm on to whatever's next. I thought I would share this little journey here for any others who find themselves in the same predicament. Cheers!
I was able to resolve this issue by specifying extra build options for Bundler which are applied when building RedCloth, as follows:
bundle config build.RedCloth --with-cflags=-w
bundle install
I am learning RoR for the first time and I am stuck on this part of the tutorial
http://www.railstutorial.org/book/static_pages#sec-first_tests
Specifically in the beginning where I am supposed to configure this gem file. I know there are other more up to date versions out but I am trying to follow the tutorial with this specific version. My gemfile is the same as the one displayed in the link.
When I run: bundle install --without production I get:
Bundler could not find compatible versions for gem "sprockets-rails":
In snapshot (Gemfile.lock):
sprockets-rails (2.1.3)
In Gemfile:
rails (= 4.0.5) ruby depends on
sprockets-rails (~> 2.0.0) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
I tried bundle update but I get:
An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.
I tried gem install nokogiri -v '1.6.1' but get:
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/bradfordli/.rvm/rubies/ruby-2.0.0-p481/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
-----
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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.
I was able to install the rmagick-2.6.0-x86-mswin32.gem gem in my windows 7 machine using gem install command and I got the following success messages:
D:\dev>gem install rmagick-2.6.0
Successfully installed rmagick-2.6.0-x86-mswin32
1 gem installed
Installing ri documentation for rmagick-2.6.0-x86-mswin32...
Installing RDoc documentation for rmagick-2.6.0-x86-mswin32...
But when I try to install using bundle install (with the same version mentioned in the Gemfile) it throws the following error messages:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
. D:/Ruby187/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.2... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.6.0. Can't find Magick-config in D:\Ruby187\bin;D:\Ruby1
....
I already have ImageMagick installed and its paths included in the env vars, but the paths mentioned in the error message above seem to be different somehow(?!)
When i type rails -v now, I get the following message:
D:\dev>rails -v
←[31mCould not find gem 'rmagick (= 2.6.0) x86-mingw32' in the gems available on
this machine.←[0m
←[33mRun `bundle install` to install missing gems.←[0m
Do i need to make any other changes/ setups to install this gem with my gemfile using bundle install?
Also I actually need an earlier gem '2.5.2' but the win32 specific version of that gem does not seem to available, is there any way to get it?
I need to do this development on windows for the moment so I can switch to any other OS for the moment. Also since this is a legacy app I am working on, I will need to stick with rmagick and can't switch to any other solution.
Env info:
Ruby: 1.8.7
Rails:
Please help!
Many thanks.
Hey have you tried installing Devkit, for installing gems with native extensions on windows.
Try the steps in the following link, and check whether the Devkit has been installed in your path variable, try opening a new command shell and install the gems.
http://doelsengupta.blogspot.in/2010/10/unable-to-download-gem-with-native.html
all the best!!
I kept having this problem but was finally able to get around it using the following solution from #Martin Cohen - after modifying the gemspec file as he has suggested and rebuilding it, i was able to successfully install rmagick gem using bundle install...
https://stackoverflow.com/a/5595274/1865578
cheers!
I am using windows and I just ran the command:
C:\Sites\cmply>gem install SystemTimer -v '1.2.3'
and I got this error:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing SystemTimer:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
make
generating system_timer_native-i386-mingw32.def
compiling system_timer_native.c
In file included from system_timer_native.c:8:0:
c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete
system_timer_native.c: In function 'install_first_timer_and_save_original_configuration':
any idea why? Prior to this I got another suspicious error:
Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3/ext/system_timer/gem_make.out
An error occured while installing SystemTimer (1.2.3), and Bundler cannot continue.
Make sure that `gem install SystemTimer -v '1.2.3'` succeeds before bundling.
and prior to that I got another error that seemed to indicate that my Ruby version is somehow out of sync:
C:\Sites\cmply>bundle update rake
Updating git://github.com/twitter/twitter-text-rb.git
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "activesupport":
In snapshot (Gemfile.lock):
activesupport (3.2.3)
In Gemfile:
rails (= 3.1.3) x86-mingw32 depends on
activesupport (= 3.1.3) x86-mingw32
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
So is it all rooted in me having an incompatible ruby version? How should this be solved?
Thanks!
You can't install system_timer gem with ruby 1.9, but it's not a bug, it's a feature. Here is the full explanation.
"system_timer is only relevant if you are running Ruby 1.8. You do not
need it if you are running Ruby 1.9"
If you're switching from Ruby 1.8 to 1.9, simply remove the system_time gem and update code dealing with timeouts.
Inspecting the output it says you're building for Ruby 1.9.3 with the include files of 1.9.1.
It looks like your Ruby installation is somehow broken. I would try to reinstall the Ruby 1.9.3 and check that the include files exist in c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.3/ and not in c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1/.