can't install most recent version of rspec - ruby

So I'm working on a gem... I type bundle, and it installs rspec 2.0.1 which, as I'm sure you'll understand, is simply unacceptable in this day and age of rspec 2.12.2 .
I'd be OK with it, except when I run rake spec...
% rake spec
/home/alg/.rvm/rubies/ruby-1.9.3-p374/bin/ruby -S bundle exec rspec "./spec/file_comparisons_spec.rb" "./spec/monitor_spec.rb" "./spec/pipboy_spec.rb"
/home/alg/Documents/Code/pipboy/spec/spec_helper.rb:8:in `block in <top (required)>': undefined method `treat_symbols_as_metadata_keys_with_true_values=' for #<RSpec::Core::Configuration:0x9c99a74> (NoMethodError)
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core.rb:67:in `configure'
from /home/alg/Documents/Code/pipboy/spec/spec_helper.rb:7:in `<top (required)>'
from /home/alg/Documents/Code/pipboy/spec/file_comparisons_spec.rb:1:in `require'
from /home/alg/Documents/Code/pipboy/spec/file_comparisons_spec.rb:1:in `<top (required)>'
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `load'
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `block in load_spec_files'
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `map'
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `load_spec_files'
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:18:in `run'
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in `run'
from /home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:10:in `block in autorun'
rake aborted!
ruby -S bundle exec rspec "./spec/file_comparisons_spec.rb" "./spec/monitor_spec.rb" "./spec/pipboy_spec.rb" failed
/home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/rake_task.rb:117:in `rescue in block (2 levels) in initialize'
/home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/rake_task.rb:113:in `block (2 levels) in initialize'
/home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/gems/rspec-core-2.0.1/lib/rspec/core/rake_task.rb:109:in `block in initialize'
/home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/bin/ruby_noexec_wrapper:14:in `eval'
/home/alg/.rvm/gems/ruby-1.9.3-p374#pipboy/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => spec
(See full trace by running task with --trace)
So here's the bits which I think are important, even though I can't find anything wrong with them:
=> Rakefile
require "bundler/gem_tasks"
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format progress"
end
=> Gemfile
source :rubygems
# Specify your gem's dependencies in pipboy.gemspec
gemspec
=> gemspec
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'pipboy/version'
Gem::Specification.new do |gem|
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'cucumber'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rdoc'
end
And, with no Gemfile.lock, the result of calling bundle...
% bundle
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Using rake (10.0.3)
Using builder (3.1.4)
Using diff-lcs (1.2.0)
Using json (1.7.6)
Using gherkin (2.11.5)
Using cucumber (1.2.1)
Using pipboy (0.0.1) from source at /home/alg/Documents/Code/pipboy
Using rdoc (3.12)
Using rspec-core (2.0.1)
Using rspec-expectations (2.0.1)
Using rspec-mocks (2.0.1)
Using rspec (2.0.1)
Using bundler (1.2.3)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
=> Gemfile.lock after the fact
PATH
remote: .
specs:
pipboy (0.0.1)
GEM
remote: http://rubygems.org/
specs:
builder (3.1.4)
cucumber (1.2.1)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.0)
json (>= 1.4.6)
diff-lcs (1.2.0)
gherkin (2.11.5)
json (>= 1.4.6)
json (1.7.6)
rake (10.0.3)
rdoc (3.12)
json (~> 1.4)
rspec (2.0.1)
rspec-core (~> 2.0.1)
rspec-expectations (~> 2.0.1)
rspec-mocks (~> 2.0.1)
rspec-core (2.0.1)
rspec-expectations (2.0.1)
diff-lcs (>= 1.1.2)
rspec-mocks (2.0.1)
rspec-core (~> 2.0.1)
rspec-expectations (~> 2.0.1)
PLATFORMS
ruby
DEPENDENCIES
cucumber
pipboy!
rake
rdoc
rspec

The trick, it seems, was to do this.
gem.add_development_dependency 'rspec', '>= 2.12.0'
rspec-core, used by rspec, is at 2.12.2 -- and I mistakenly thought that these sub-gems would minor up at the same time as the meta-gem.
Then again, I have -no idea- why it was downloading rspec 2.0.1 and not 2.12.0 ...

Related

test-first- ruby 00_hello parse error: OptionParser::InvalidOption

I am having a hard time figure out the first lesson on Test-First Ruby (Alex Chaffee), I am running "rake" test and am getting errors that I am not supposed to receive.
I already tried doing the gem update --system and removing spaces as suggested in previous posts. None of this solved the problem.
Bellow are my specs and errors received.
I will appreciate any help.
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
C:\Users\Greice>gem list
*** LOCAL GEMS ***
activemodel (4.1.4)
activerecord (4.1.4)
activesupport (4.1.4)
arel (5.0.1.20140414130214)
bigdecimal (1.2.5, 1.1.0)
builder (3.2.2)
bundler (1.6.5)
diff-lcs (1.2.5)
feedtools (0.2.29)
hpricot (0.8.6)
i18n (0.6.11)
io-console (0.4.2, 0.3)
json (1.8.1, 1.5.5)
minitest (5.4.0, 2.5.1)
rake (10.3.2, 0.9.2.2)
rdoc (4.1.1, 3.9.5)
RedCloth (4.2.9 x86-mingw32)
rspec (3.0.0, 2.0.1)
rspec-core (3.0.3, 2.0.1)
rspec-expectations (3.0.3, 2.0.1)
rspec-mocks (3.0.3, 2.0.1)
rspec-support (3.0.3)
rubygems-update (2.4.1)
sunlight-congress (1.1.0)
thread_safe (0.3.4)
tzinfo (1.2.1)
uuidtools (2.1.4)
C:\Users\Greice\Desktop\test-first-ruby-master>cd 00_hello
C:\Users\Greice\Desktop\test-first-ruby-master\00_hello>rake
(in C:/Users/Greice/Desktop/test-first-ruby-master)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/option_parse
r.rb:18:in `parse!': invalid option: --warnings (OptionParser::InvalidOption)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core
/option_parser.rb:4:in `parse!'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core
/configuration_options.rb:78:in `parse_options_file'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core
/configuration_options.rb:74:in `parse_global_options'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core
/configuration_options.rb:48:in `parse_options'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core
/runner.rb:41:in `run'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core
/runner.rb:10:in `block in autorun'
rake aborted!
ruby -S bundle exec rspec -IC:/Users/Greice/Desktop/test-first-ruby-master/00_he
llo -IC:/Users/Greice/Desktop/test-first-ruby-master/00_hello/solution -f docume
ntation -r ./rspec_config "C:/Users/Greice/Desktop/test-first-ruby-master/00_hel
lo/hello_spec.rb" failed
Tasks: TOP => default => spec
(See full trace by running task with --trace)
Rakefile
# This Rakefile has all the right settings to run the tests inside each lab
gem 'rspec', '~>2'
require 'rspec/core/rake_task'
task :default => :spec
desc "run tests for this lab"
RSpec::Core::RakeTask.new do |task|
lab = Rake.application.original_dir.gsub(' ', '\ ')
task.pattern = "#{lab}/*_spec.rb"
task.rspec_opts = [ "-I#{lab}", "-I#{lab}/solution", '-f documentation', '-r ./rspec_config']
task.verbose = false
end
rspec_config.rb
RSpec.configure do |c|
c.fail_fast = true
c.color = true
end
I've seen this before when --warnings was an option in the .rspec file.
Try removing the --warnings line from your .rspec or rspec_config file.

Debugging cucumber in Ruby error

I was able to debug my code with no issues until today. I don't know what I changed that could have effected this but now my
require "ruby-debug"
in my env.rb is causing the following when i try to run a feature...
cannot load such file -- irb/init (LoadError)
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/lib/ruby/1.9.1/irb.rb:13:in `<top (required)>'
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/irb.rb:1:in `<top (required)>'
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:51:in `block in load_commands'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:50:in `each'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:50:in `load_commands'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:210:in `<module:Debugger>'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:5:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:2:in `require_relative'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:2:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:6:in `require_relative'
/usr/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:6:in `<top (required)>'
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require'
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
/usr/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require'
/cygdrive/c/zap2it.com_acceptance_tests/features/support/env.rb:10:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/rb_support/rb_language.rb:137:in `load'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/rb_support/rb_language.rb:137:in `load_code_file'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/runtime/support_code.rb:180:in `load_file'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/runtime/support_code.rb:82:in `each'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/runtime.rb:182:in `load_step_definitions'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/runtime.rb:41:in `run!'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/cli/main.rb:43:in `execute!'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/lib/cucumber/cli/main.rb:20:in `execute'
/usr/lib/ruby/gems/1.9.1/gems/cucumber-1.2.3/bin/cucumber:14:in `<top (required)>'
/usr/bin/cucumber:23:in `load'
/usr/bin/cucumber:23:in `<main>'
If I remove it everything runs fine but i still do not have debugging capabilities.
Any ideas on what could be causing this?
So weeks later and I'm still having this issue, I've tried uninstall-reinstall all my gems and tried ruby-debug19, ruby-debug-base19, and debugger. I've tried requiring 'debugger' or 'ruby-debug' in my env file but still same error. Could it be i'm missing another needed library?
Here is the GemFile.lock:
GEM
remote: https://rubygems.org/
specs:
archive-tar-minitar (0.5.2)
builder (3.2.0)
capybara (2.1.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
columnize (0.3.6)
commonwatir (4.0.0)
cucumber (1.2.3)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.6)
multi_json (~> 1.3)
diff-lcs (1.2.1)
ffi (1.5.0)
gherkin (2.11.6)
json (>= 1.7.6)
httpclient (2.3.2)
json (1.7.7)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
mime-types (1.23)
multi_json (1.7.1)
nokogiri (1.5.9)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rake (10.0.3)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.0)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rubyzip (0.9.9)
selenium-webdriver (2.31.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip
websocket (~> 1.0.4)
watir (4.0.2)
commonwatir (~> 4)
watir-webdriver
watir-webdriver (0.6.2)
selenium-webdriver (>= 2.18.0)
websocket (1.0.7)
xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
capybara
cucumber
httpclient
nokogiri
rake
rspec
ruby-debug19
selenium-webdriver
watir
watir-webdriver
And the GemFile:
source 'https://rubygems.org'
gem 'rake'
gem 'nokogiri'
gem 'httpclient'
group :test do
gem 'rspec'
gem 'cucumber'
gem 'watir'
gem 'watir-webdriver'
gem 'selenium-webdriver'
gem 'capybara'
end
Have you updated rails or ruby lately?
I do not remember which version update that causes problems but I think the error message looks like some I got after an update. After which the ruby-debug is no longer supported.
After some digging I found the following gems as substitution:
gem 'ruby-debug-base19x'
gem 'ruby-debug19'
These are however outdated, so maybe look into the debugger gem
The solution for this problem is to remove and install as here or
sudo apt-get install libreadline-dev
rvm remove 1.9.3
rvm install 1.9.3
Then add to your Gemfile:
gem 'rb-readline
as here

linecache error when running rails server

I am getting the following error when running 'rails server' command. Here is the error:
maruf#phoenix:/media/resource/RoR/project$ rails server
/usr/local/rvm/gems/ruby-1.9.2-p320#project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/tracelines19.rb:12:in `require': no such file to load -- /usr/local/rvm/gems/ruby-1.9.2-p320#project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/../lib/trace_nums19 (LoadError)
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/tracelines19.rb:12:in `rescue in <module:TraceLineNumbers>'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/tracelines19.rb:8:in `<module:TraceLineNumbers>'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/tracelines19.rb:6:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/linecache19.rb:69:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/linecache19.rb:69:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
from /media/resource/RoR/project/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/railties-3.2.11/lib/rails/commands.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/railties-3.2.11/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.2-p320#project/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Here is the Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'zclip-rails'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
gem "therubyracer"
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem "twitter-bootstrap-rails"
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
gem 'linecache19', '>= 0.5.13', :git => 'https://github.com/robmathews /linecache19-0.5.13.git'
gem 'ruby-debug-base19x', '>= 0.11.30.pre10'
gem 'ruby-debug-ide', '>= 0.4.17.beta14'
Here is the output of 'gem list' command:
actionmailer (3.2.11)
actionpack (3.2.11)
activemodel (3.2.11)
activerecord (3.2.11)
activeresource (3.2.11)
activesupport (3.2.11)
archive-tar-minitar (0.5.2)
arel (3.0.2)
builder (3.0.4)
bundler (1.2.3)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0)
columnize (0.3.6)
commonjs (0.2.6)
debugger-linecache (1.1.2)
debugger-ruby_core_source (1.1.7)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.2.0)
json (1.7.6)
less (2.2.2)
less-rails (2.2.6)
libv8 (3.11.8.13 x86-linux)
linecache19 (0.5.12)
mail (2.4.4)
mime-types (1.19)
multi_json (1.5.0)
mysql2 (0.3.11)
polyglot (0.3.3)
rack (1.4.4)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
rails (3.2.11)
railties (3.2.11)
rake (10.0.3)
rbx-require-relative (0.0.9)
rdoc (3.12)
ref (1.0.2)
ruby-debug-base19 (0.11.25)
ruby-debug-base19x (0.11.30.pre10)
ruby-debug-ide (0.4.17.beta16, 0.4.17.beta14)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5)
sass (3.2.5)
sass-rails (3.2.6)
sprockets (2.2.2)
therubyracer (0.11.3)
thor (0.17.0)
tilt (1.3.3)
treetop (1.4.12)
twitter-bootstrap-rails (2.2.0)
tzinfo (0.3.35)
uglifier (1.3.0)
zclip-rails (0.0.1)
I am using
Rails 3.2.11
and
ruby 1.9.2p320 (2012-04-20 revision 35421) [i686-linux]
How can I solve this problem to run the server?
The version of linecache19 listed in your Gemfile seems to be more recent than the one displayed by 'gem list'. Have you tried to run 'bundle update'?
I solved the same issue by copying trace_nums19.bundle into the folder where its missing. You can find this file somewhere in your lib folder of your linecache gem

Rspec - Formatter 'specdoc' unknown - maybe you meant 'documentation'

I'm developing a gem. There is a folder titled /spec and it contains 2 files:
#spec_helper.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'my_gem'
#my_gem_spec.rb
describe MyGem do
it 'should have a version number' do
MyGem::VERSION.should_not be_nil
end
#............
end
Then I run it
rspec spec
/var/lib/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:491:in `add_formatter': Formatter 'specdoc' unknown - maybe you meant 'documentation' or 'progress'?. (ArgumentError)
from /var/lib/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/configuration_options.rb:30:in `block in configure'
from /var/lib/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/configuration_options.rb:30:in `each'
from /var/lib/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/configuration_options.rb:30:in `configure'
from /var/lib/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:21:in `run'
from /var/lib/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:80:in `run'
from /var/lib/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:17:in `block in autorun'
What does it mean? How to get rid of it?
Here is the bundle's output
bundle install
Using rake (10.0.3)
Using diff-lcs (1.1.3)
Using my_gem (0.0.1) from source at .
Using rspec-core (2.12.2)
Using rspec-expectations (2.12.1)
Using rspec-mocks (2.12.1)
Using rspec (2.12.0)
Using bundler (1.3.0.pre.4)
Uninstall all previous versions of rspec and its dependencies.
gem uninstall rspec
gem uninstall rspec-core
gem uninstall rspec-mocks
gem uninstall rspec-expectations
Install the correct version of rspec in gem file install rspec.
group :development, :test do
gem 'rspec-rails', '~> 3.0.0'
end
see this answer

ruby rake with rails missing constant with production but works in development environment

I have a rake task that runs ok in the dev env, but not in prod.
task :sample_test_quote => :environment do
QuoterTester.test
end
QuoterTester is a model class with a class method test.
Running the task under dev works fine, like this:
rake sample_test_quote
Whereas under prod, I get this:
$ RAILS_ENV=production rake sample_test_quote --trace
** Invoke sample_test_quote (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute sample_test_quote
rake aborted!
uninitialized constant QuoterTester
org/jruby/RubyModule.java:2590:in `const_missing'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
org/jruby/RubyMethod.java:133:in `call'
/Users/kimptoc/Documents/ruby/ecom/ecom1/lib/tasks/sample_test_quote.rake:3:in `(root)'
org/jruby/RubyProc.java:270:in `call'
org/jruby/RubyProc.java:220:in `call'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
org/jruby/RubyArray.java:1612:in `each'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/kimptoc/.rvm/rubies/jruby-1.6.5/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
org/jruby/RubyArray.java:1612:in `each'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#global/gems/rake-0.9.2.2/bin/rake:33:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
/Users/kimptoc/.rvm/gems/jruby-1.6.5#p-ecom1-rails311/bin/rake:19:in `(root)'
Tasks: TOP => sample_test_quote
I am using JRuby 1.6.5, with mysql - the prod and dev database.yml are pretty much the same settings. Also using a Gemfile - see below.
From this question, I am guessing its a problem with one of classes in the project.
So, any tips on how to track down which class?
Strangely, rails server/console both work in prod env - I'd have expected them to fail too.
TIA, Chris
Here is the Gemfile I am using
source 'http://rubygems.org'
gem 'rake'
gem 'rails', '3.1.1'
if defined?(JRUBY_VERSION)
#jruby gems
gem 'activerecord-jdbc-adapter'
#gem 'activerecord-jdbc-adapter', :git => "https://github.com/jruby/activerecord-jdbc-adapter.git"
#gem 'activerecord-jdbcmysql-adapter'
#gem 'activerecord-jdbcmysql-adapter', :path => '../../libs/activerecord-jdbc-adapter.kimptoc'
#gem 'activerecord-jdbcmysql-adapter',:git => "https://github.com/kimptoc/activerecord-jdbc-adapter.git"
gem 'activerecord-jdbcmysql-adapter',:git => "https://github.com/jruby/activerecord-jdbc-adapter.git"
gem "jruby-openssl"
else
#non jruby gems
gem 'mysql'
end
gem "letter_opener", :group => :development
gem "mechanize", "1.0.0"
gem "nokogiri","1.4.6"
gem "roo"
gem "rubyzip"
gem "parallel"
gem "savon", "=0.7.9"
group :development, :test do
gem "rcov"
gem "pry"
end
gem "fastercsv"
gem "xml-simple"
gem "rabl"
gem 'bcrypt-ruby', :require => 'bcrypt'
gem 'newrelic_rpm'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', " ~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
gem "acts_as_executor", :git => "https://github.com/philostler/acts_as_executor.git"
gem 'rufus-scheduler'
And here are the actual gems:
actionmailer (3.1.1)
actionpack (3.1.1)
activemodel (3.1.1)
activerecord (3.1.1)
activeresource (3.1.1)
activesupport (3.1.1)
addressable (2.2.6)
arel (2.2.1)
bcrypt-ruby (3.0.1 java)
bouncy-castle-java (1.5.0146.1)
builder (3.0.0)
bundler (1.0.21)
coderay (0.9.8)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.1.2)
crack (0.3.1)
erubis (2.7.0)
execjs (1.2.9)
fastercsv (1.5.4)
google-spreadsheet-ruby (0.1.5)
hike (1.2.1)
hoe (2.12.3)
i18n (0.6.0)
jquery-rails (1.0.16)
jruby-launcher (1.0.9 java)
jruby-openssl (0.7.4)
json (1.6.1 java)
launchy (2.0.5)
letter_opener (0.0.2)
mail (2.3.0)
mechanize (1.0.0)
method_source (0.6.6)
mime-types (1.17.1, 1.16)
multi_json (1.0.3)
newrelic_rpm (3.2.0)
nokogiri (1.4.6 java)
oauth (0.4.5)
parallel (0.5.9)
polyglot (0.3.2)
pry (0.9.6.2 java)
rabl (0.5.0, 0.3.0)
rack (1.3.5, 1.3.4)
rack-cache (1.1)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.1)
railties (3.1.1)
rake (0.9.2.2, 0.9.2)
rcov (0.9.11 java)
rdoc (3.11, 3.10)
roo (1.9.5)
ruby-ole (1.2.11.2)
ruby_parser (2.0.6)
rubyzip (0.9.4)
rufus-scheduler (2.0.12)
sass (3.1.10)
sass-rails (3.1.4)
savon (0.7.9)
sexp_processor (3.0.7)
slop (2.1.0)
spoon (0.0.1)
spreadsheet (0.6.5.9)
sprockets (2.0.3, 2.0.2)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.30)
uglifier (1.0.4, 1.0.3)
weakling (0.0.4 java)
xml-simple (1.1.1)
This is a fairly common issue when Rake tasks are run in production mode if config.threadsafe! is enabled, which it should be for JRuby apps.
A possible fix is to edit your environment so that config.threadsafe! is disabled only when you are running a Rake task (You can make up your own environment variable for this purpose).

Resources