Installing Webistrano on Debian squeeze 64bits - ruby

I'm currently trying to install Webistrano on a freshly installed debian squeeze 64bits, but I'm facing some issues that I can't manage to solve.
Note: The machine is created under Xen environment, I don't think this affect the procedure however it seemed important to mention it.
Procedure:
Informations:
Ruby version: ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
Rails version: `Rails 2.3.11
Path modifier with: /usr/lib/ruby/1.8:/var/lib/gems/1.8/bin
Rails env: development
Databases have been created
Databases setups for webistrano are, I believe correct (user/pass/path_to_sock_file)
So, here is what I did:
I first installed the 'basics' packages for such installation:
# apt-get install build-essential ruby rubygems libmysql-ruby libmysqlclient-dev libdbd-mysql-ruby mysql-server unzip rake
Then I have been downloading and extracting the project into /usr/src. After copying and configuring the files for email/databses setups (as suggested by https://github.com/peritor/webistrano), I continued by installing all the gems needed for the project:
bundle install
at this point, the command is stuck and isn't doing anything for an hour.
I know it can happen if the Gemfile is complicate, but it doesn't seem to be the case for me. (see the Gemfile following)
# cat Gemfile
source "http://rubygems.org"
gem 'bundler', "~>1.0.10"
gem "rails", "2.3.11"
gem "mysql"
gem "erubis"
gem "rake"
gem "syntax", "1.0.0"
gem "capistrano", "2.6.0"
gem "open4", "0.9.3"
gem "exception_notification", "2.3.3.0"
group :test do
gem "mocha", "0.9.8"
end
So deciding to go ahead I installed the gems by hands, which once finished gives:
# gem list *gems of Gemfile*
bundler (1.0.10)
rails (2.3.11)
mysql (2.8.1)
erubis (2.7.0)
rake (0.9.2.2)
syntax (1.0.0)
capistrano (2.6.0)
open4 (0.9.3)
exception_notification (2.3.3.0)
mocha (0.9.8)
So I believe everything should be working without having to run: bundle install
This is why I finally tried to create the database's structure with rake:
# rake db:migrate --trace
(in /usr/src/peritor-webistrano-a98ba6b)
rake aborted!
Bundler couldn't find some gems.Did you run `bundle install`?
/usr/src/peritor-webistrano-a98ba6b/config/../config/preinitializer.rb:18
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:28:in `load'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:28:in `preinitialize'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:10:in `boot!'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:123
/usr/src/peritor-webistrano-a98ba6b/Rakefile:4:in `require'
/usr/src/peritor-webistrano-a98ba6b/Rakefile:4
/usr/lib/ruby/1.8/rake.rb:2383:in `load'
/usr/lib/ruby/1.8/rake.rb:2383:in `raw_load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2017:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2016:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2000:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28
According to rake error message, apparently some gems aren't properly installed, which seems weird to be, but I guess he can't find it.
So I double check with bundle tool:
# bundle check
Your Gemfile's dependencies could not be satisfied
Install missing gems with `bundle install`
# bundle show
Could not find gem 'mocha (= 0.9.8, runtime)' in any of the gem sources listed in your Gemfile.
And I'm stuck here, I just don't know how to continue.
I google around about mocha or gemfile issue, but haven't found much relevant.
I hope everything is clear and easy to understand as this is my first post.
Thanks for any reply/hints, also if I manage to evolve I'll try keeping you up to date!

Check these instructions:
http://www.gogolek.co.uk/blog/2012/10/web-application-deployment-webistrano-capistrano/
Additionally I had problems with mysql gem installation on my clean debian 6 64-bit, so I had to run
$ apt-get install libmysqlclient-dev ruby-dev
I ended up with following gems installed
Using rake (0.8.7)
Using activesupport (2.3.11)
Using rack (1.1.6)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using activerecord (2.3.11)
Using activeresource (2.3.11)
Using bundler (1.0.10)
Using highline (1.6.20)
Using net-ssh (2.7.0)
Using net-scp (1.1.2)
Using net-sftp (2.1.2)
Using net-ssh-gateway (1.2.0)
Using capistrano (2.6.0)
Using erubis (2.7.0)
Using exception_notification (2.3.3.0)
Using mocha (0.9.8)
Installing mysql (2.9.1) with native extensions
Installing open4 (0.9.3)
Installing rails (2.3.11)
Installing syntax (1.0.0)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

Related

Ruby bundler installing unwanted version of puppet gem

I have the following script
PUPPET_VERSION=3.7.4
ruby='1.8.7-p374'
rvm use $ruby#$$ --create
gem install bundler
bundle install --gemfile=.gemfile
This has worked for several months but sadly now it has decided to stop working.
After this script rake is called to run some rspec tasks
On the centos 6.6 bamboo test runner the process fails.
On the centos 6.4 development machine it still works
On my development machine this script (+rake tasks ) works like so
Fetching gem metadata from http://rubygems.org/.........
Fetching version metadata from http://rubygems.org/..
Installing rake 10.4.2
Installing CFPropertyList 2.2.8
Installing builder 3.2.2
Installing diff-lcs 1.2.5
Installing facter 2.4.1
Installing json_pure 1.8.2
Installing hiera 1.3.4
Installing metaclass 0.0.4
Installing mocha 1.1.0
Installing puppet 3.7.4
Installing puppet-lint 1.1.0
Installing puppet-syntax 1.4.1
Installing rspec-core 2.99.2
Installing rspec-expectations 2.99.2
Installing rspec-mocks 2.99.3
Installing rspec 2.99.0
Installing rspec-puppet 2.0.0
Installing puppetlabs_spec_helper 0.8.2
Installing rspec_junit_formatter 0.2.0
Using bundler 1.9.4
Bundle complete! 3 Gemfile dependencies, 20 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
manifests found
~/gitf/puppetmaster_np/local_modules/iop_4store/spec/fixtures/modules ~/gitf/puppetmaster_np/local_modules/iop_4store
~/gitf/puppetmaster_np/local_modules/iop_4store
/home/jan/.rvm/rubies/ruby-1.9.3-p484/bin/ruby -S rspec ./spec/classes/iop_4store_spec.rb --no-drb -r rspec_junit_formatter --format RspecJunitFormatter -o junit.xml --deprecation-out /dev/null
WARN: Unresolved specs during Gem::Specification.reset:
rake (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Removing gemset 16612......
However on the bamboo agent node it does this
The source :rubygems is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Using rake 10.4.2
Using CFPropertyList 2.2.8
Using builder 3.2.2
Using diff-lcs 1.2.5
Using facter 2.4.3
Using json_pure 1.8.2
Using hiera 2.0.0
Using metaclass 0.0.4
Using mocha 1.1.0
Using puppet 4.0.0
Using puppet-lint 1.1.0
Using puppet-syntax 2.0.0
Using rspec-support 3.2.2
Using rspec-core 3.2.3
Using rspec-expectations 3.2.1
Using rspec-mocks 3.2.1
Using rspec 3.2.0
Using rspec-puppet 2.0.1
Using puppetlabs_spec_helper 0.10.2
Using rspec_junit_formatter 0.2.0
Using bundler 1.9.4
Bundle complete! 3 Gemfile dependencies, 21 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
manifests found
~/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store/spec/fixtures/modules ~/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store
~/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store
/usr/local/rvm/rubies/ruby-1.9.3-p484/bin/ruby -I/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-support-3.2.2/lib:/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb --no-drb -r rspec_junit_formatter --format RspecJunitFormatter -o junit.xml --deprecation-out /dev/null
WARN: Unresolved specs during Gem::Specification.reset:
rake (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/puppetlabs_spec_helper-0.10.2/lib/puppetlabs_spec_helper/module_spec_helper.rb:23:in `block in <top (required)>': undefined method `environmentpath=' for #<RSpec::Core::Configuration:0x000000025a4068> (NoMethodError)
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core.rb:101:in `configure'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/puppetlabs_spec_helper-0.10.2/lib/puppetlabs_spec_helper/module_spec_helper.rb:22:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
from /home/bamboo/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store/spec/spec_helper.rb:2:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/bamboo/bamboo-agent-home/xml-data/build-dir/PUP-RCTAP-JOB1/local_modules/iop_4store/spec/classes/iop_4store_spec.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/exe/rspec:4:in `<main>'
/usr/local/rvm/rubies/ruby-1.9.3-p484/bin/ruby -I/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-support-3.2.2/lib:/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/lib /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rspec-core-3.2.3/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb --no-drb -r rspec_junit_formatter --format RspecJunitFormatter -o junit.xml --deprecation-out /dev/null failed
/usr/local/rvm/gems/ruby-1.9.3-p484#27314 did not previously exist. Ignoring.
The tests fail and I'm sure that having a wildly different version of puppet (and other gems) is not helping. Also, our systems aren't running puppet 4
Here is the gemfile that is being used
source :rubygems
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>=
2.7']
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'rspec_junit_formatter'
So my problem is that the scripts shown previously loaded the correct gems into rvm and executed the tests "as if" puppet 3.7.0. Now they try and load puppet 4 and the tests fail.
Thanks
Here's what I did to "make it work" Not entirely sure why this fixed it
First, alter the gemfile to copy most of the versions of the gem dependencies from the other server where it still works
source 'https://rubygems.org'
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>=
2.7', '< 4.0']
gem 'diff-lcs', '1.2.5'
gem 'facter'
gem 'hiera', '1.3.4'
gem 'json_pure', '1.8.2'
gem 'metaclass', '0.0.4'
gem 'mocha', '1.1.0'
gem 'puppet', puppetversion
gem 'puppet-lint', '1.1.0'
gem 'puppet-syntax', '1.4.1'
gem 'puppetlabs_spec_helper', '0.8.2'
gem 'rake'
gem 'rspec', '2.99.0'
gem 'rspec-core', '2.99.2'
gem 'rspec-expectations', '2.99.2'
gem 'rspec-mocks', '2.99.3'
gem 'rspec-puppet', '2.0.0'
gem 'rspec_junit_formatter', '0.2.0'
Next, add a couple of "bundle update" and a "bundlee clean --force" to the script.
PUPPET_VERSION=3.7.4
ruby='1.9.3-p484'
rvm use $ruby#$$ --create
gem install bundler
ln -s .gemfile Gemfile
bundle clean --force
bundle update rspec
bundle install --gemfile=.gemfile
bundle update rspec
(the eagle eyed will note that I'm running a different ruby too)

Bundler error when executing berks command from a rake task on windows

I wrote a rake task to execute the berks package command on a Berksfile in a sub-directory:
task :cook do
`berks package ./cookbooks.tar.gz -b ./cookbook/Berksfile`
end
I've also tried these variations:
task :cook do
`.\\scripts\\berks_package.bat` # containing stuff
end
task :cook do
`C:\\opscode\\chefdk\\embedded\\bin\\ruby.exe "C:\\opscode\\chefdk\\bin\\berks" package ..\\cookbooks.tar.gz -b ..\\cookbook\\Berksfile`
end
No matter the way I execute berks, the task fails with the following error:
C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/resolver.rb:434:in `version_conflict': Bundler could not find compatible versions for gem "nokogiri": (Bundler::VersionConflict)
In snapshot (Gemfile.lock):
nokogiri (1.6.5)
In Gemfile:
albacore (~> 2.0.0) x86-mingw32 depends on
nokogiri (~> 1.5) x86-mingw32
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/resolver.rb:232:in `resolve_for_conflict'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/resolver.rb:250:in `resolve_conflict'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/resolver.rb:373:in `resolve'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/resolver.rb:166:in `start'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/resolver.rb:129:in `resolve'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/definition.rb:193:in `resolve'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/definition.rb:132:in `specs'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/definition.rb:177:in `specs_for'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/definition.rb:166:in `requested_specs'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/environment.rb:18:in `requested_specs'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/runtime.rb:13:in `setup'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler.rb:122:in `setup'
from C:/tools/ruby213/lib/ruby/gems/2.1.0/gems/bundler-1.7.9/lib/bundler/setup.rb:17:in `<top (required)>'
from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
rake aborted!
Albacore::CommandFailedError: Command failed with status (1):
.\scripts\berks_package.bat
Executing berks package ./cookbooks.tar.gz -b ./cookbook/Berksfile from a command prompt works as does executing other normal system commands inside the task.
Gemfile:
source 'https://rubygems.org'
gem 'albacore', '~> 2.0.0'
gem 'semver2', '~> 3.4.0'
Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
albacore (2.0.16)
map (~> 6.5)
nokogiri (~> 1.5)
rake (~> 10)
semver2 (~> 3.4)
map (6.5.5)
mini_portile (0.6.1)
nokogiri (1.6.5-x64-mingw32)
mini_portile (~> 0.6.0)
rake (10.4.2)
semver2 (3.4.0)
PLATFORMS
x64-mingw32
DEPENDENCIES
albacore (~> 2.0.0)
semver2 (~> 3.4.0)
I figured out the problem as I wrote the question and stumbled upon new ideas.
The root problem was that the Ruby binary and gems installed with the ChefDK were conflicting with the system install of Ruby. Specifically, the rake task was executed under the system Ruby installation, but when berks was executed, it ran under the embedded ChefDK Ruby. I'm not clear on this next part, but it seems that the ChefDK Ruby was aware of the Gemfile and tried to resolve the dependencies itself, but because nokogiri cannot be resolved (i.e. built) by bundler on Windows without pain, it failed.
Here is what I did to resolve the issue:
Uninstalled the system Ruby
Added C:\opscode\chefdk\bin to the system PATH variable so I could run ruby, rake, gem, bundle, etc.
Ran gem install nokogiri (now executed under the ChefDK's Ruby)
Recreated the Gemfile.lock file by running bundle install
Surrounded the berks system call with a Bundler.with_clean_env block (this is key!)
Thanks to this question
The task now looks like:
task :cook do
Bundler.with_clean_env do
`berks package cookbooks.tar.gz -b .\\cookbook\\Berksfile`
end
end

Ruby Compass Compiler not working, error on line [54]

Ruby Compass not working, code is bellow, and I've tried 10-20 methods on the web, any suggestions ?
In the screenshot you'll find an easier way to read the terminal dump of my gems and the error, in case you want to take something from there, you'll find the text under the screenshot
Thanks,
Cheers,
Robert
RubyGems is a sophisticated package manager for Ruby. This is a
basic help message containing pointers to more information.
Usage:
gem -h/--help
gem -v/--version
gem command [arguments...] [options...]
Examples:
gem install rake
gem list --local
gem build package.gemspec
gem help install
Further help:
gem help commands list all 'gem' commands
gem help examples show some examples of usage
gem help gem_dependencies gem dependencies file guide
gem help platforms gem platforms guide
gem help <COMMAND> show help on COMMAND
(e.g. 'gem help install')
gem server present a web page at
http://localhost:8808/
with info about installed gems
Further information:
http://guides.rubygems.org
sh-3.2# gem list
*** LOCAL GEMS ***
bigdecimal (1.2.5, 1.2.0)
CFPropertyList (2.2.8, 2.2.0)
chunky_png (1.3.1)
compass (1.0.1)
compass-core (1.1.0.alpha.0, 1.0.1)
compass-import-once (1.0.5)
ffi (1.9.3)
io-console (0.4.2)
json (1.8.1, 1.7.7)
libxml-ruby (2.7.0, 2.6.0)
mini_portile (0.6.0)
minitest (5.4.1, 4.3.2)
multi_json (1.10.1)
nokogiri (1.6.3.1, 1.5.6)
power_assert (0.1.3)
psych (2.0.5, 2.0.0)
rake (10.3.2, 0.9.6)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
rdoc (4.1.1, 4.0.0)
rubygems-update (2.4.1)
sass (3.4.2)
sqlite3 (1.3.9, 1.3.7)
test-unit (3.0.1, 2.0.0.0)
sh-3.2# compass compile -e production --force
LoadError on line ["54"] of /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- rgbapng
Run with --trace to see the full backtrace
Fixed by installing the following compass extensions :
gem install compass-normalize
gem install compass-rgbapng
gem install toolkit
That did not fix it for me. However, I was able to fix it by reinstalling the compass gem using
gem uninstall compass
gem install compass
I think you can probably fix it even easier by just updating the compass gem to the latest version using gem update compass.
Note: If you use rails, you might also have to update your compass-rails gem. Otherwise, the compass watch command will start to hang. See this issue on github

Trying to update to gem 3.0.20 and install a DevKit

Heroku advised updating to this gem because of a security patch but it has caused me all kinds of headaches and now my local environment isn't working correctly. They suggested doing this as a security precaution. They suggested going into my app, changing the gemfile version and simply running 'bundle update rails'. Here was the output:
$ bundle update rails
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.20)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.20)
Using erubis (2.6.6)
Using rack (1.2.8)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.37)
Using actionpack (3.0.20)
Using mime-types (1.21)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.2.19)
Using actionmailer (3.0.20)
Using arel (2.0.10)
Using activerecord (3.0.20)
Using activeresource (3.0.20)
Using bundler (1.0.22)
Installing json (1.7.7) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
c:/Ruby192/bin/ruby.exe extconf.rb
creating Makefile
make
'make' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in c:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.7.7 for inspection.
Results logged to c:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.7.7/ext/json/ext/generator/gem_make.out
An error occured while installing json (1.7.7), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.7'` succeeds before bundling
Then they pointed to a thread on here of someone having a similar problem. It involved downloading a Devkit etc. I tried following the instructions but now everything is just broke. I'm familiar working with Ruby on Rails but never had to install it (was already set up on my work computer) and I find it hard to believe that updating it is this difficult when the whole philosophy behind ruby on rails is simplicity. I've got to be missing something or not using the proper resource.
The current version of ruby on my machine is ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
$rails --version
Rails 3.0.3
And the DevKit I downloaded is
DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
from http://rubyinstaller.org/downloads
I then tried to walk through the installation steps on this site https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
It always comes back to a 'make' error or 'json' error.
Maybe I have different versions conflicting??
Now I get the following error when I just try to start WEBrick to run my app:
$ rails s
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/rubygems_integrat
ion.rb:183:in `stub_source_index170': uninitialized constant Gem::SourceIndex (N
ameError)
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/ruby
gems_integration.rb:303:in `stub_rubygems'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/ruby
gems_integration.rb:246:in `replace_entrypoints'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runt
ime.rb:14:in `setup'
from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler.rb:1
10:in `setup'
from c:/rails/thumb/costrecovery/config/boot.rb:8:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from script/rails:5:in `<main>'
Any advice is greatly appreciated.

Rake 0.8.7 and ActiveSupport 3.0.1

I am running Ruby 1.9.2. I have rake 0.8.7 installed. However running rake inside a Rails application gives me the following:
(in /usr/home/users/dimitar/Rails/spek)
Could not find activesupport-3.0.1 in any of the sources
Try running `bundle install`.
So I go ahead and run bundle install again and everything looks good:
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.1)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.1)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.6)
Using tzinfo (0.3.23)
Using actionpack (3.0.1)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.7)
Using actionmailer (3.0.1)
Using arel (1.0.1)
Using activerecord (3.0.1)
Using activeresource (3.0.1)
Using bundler (1.0.3)
Using thor (0.14.3)
Using railties (3.0.1)
Using rails (3.0.1)
Using sqlite3-ruby (1.3.1)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
But rake still gives me the same error message. Any suggestions?
Actually the problem seems to come from the config/boot.rb file:
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
Do you have multiple Ruby interpreters installed (maybe via rvm or some other method)? If so, are you sure that the right one is active?
Things to look at:
which ruby
which rake
ruby -e 'puts $:' # To show the LOAD_PATH for gems
I had a similar problem using ruby-1.9.2 and fixed it by upgrading rubygems
sudo gem update --system
I had the same problem when I was using REE 1.8.7. I switched to 1.9.2 and did bundle install. Then my rake commands worked.
I had this issue when I mistakenly ran passenger with ruby 1.9.3 and the app used 1.8.7 in its .rvmrc. Fixed by using 1.9.3 (now I have encoding problems, but thats a different story).

Resources