1) JunksController routing routes to #index
Failure/Error: get("/junks").should route_to("junks#index")
NoMethodError:
undefined method `assertions' for #<#<Class:0x007ff8d62c8568>:0x007ff8d13e2f20>
# ./spec/routing/junks_routing_spec.rb:7:in `block (3 levels) in <top (required)>'
The only hint I have is that MiniTest v5 is throwing deprecation warnings.
MiniTest::Unit::TestCase is now Minitest::Test. From /Users/username/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/test/unit/testcase.rb:8:in `<module:Unit>'
In a recent update of Gems, I started getting an undefined method `assertions' for all of my routing specs. I generated a new scaffold, it too is raising the same error
Versions:
rails (3.2.13)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-rails (2.13.2)
minitest (5.0.2)
capybara (2.1.0)
rack-test (0.6.2)
It turns out the Minitest gem was the culprit. I locked the gem's version and all routing specs are passing again. Yea!
gem 'minitest', '~> 4.0'
Related
I am currently setting up some Cucumber tests and my Hook file contains the following :
require 'watir'
Before do
#browser = Watir::Browser.new :chrome
end
After do
#browser.close
end
When I run my feature file I get the following:
cannot load such file -- watir (LoadError)
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/marklane/RubymineProjects/test_puppies/features/support/hooks.rb:2:in `<top (required)>'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `each'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:in `load_step_definitions'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in `run!'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'
/Users/marklane/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'
/Users/marklane/.rbenv/versions/1.9.3-p194/bin/cucumber:23:in `load'
/Users/marklane/.rbenv/versions/1.9.3-p194/bin/cucumber:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
My Gem File Lock is:
GEM
remote: https://rubygems.org/
specs:
backports (3.10.3)
builder (3.2.3)
childprocess (0.8.0)
ffi (~> 1.0, >= 1.0.11)
concurrent-ruby (1.0.5)
cucumber (3.0.1)
builder (>= 2.1.2)
cucumber-core (~> 3.0.0)
cucumber-expressions (~> 4.0.3)
cucumber-wire (~> 0.0.1)
diff-lcs (~> 1.3)
gherkin (~> 4.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (3.0.0)
backports (>= 3.8.0)
cucumber-tag_expressions (>= 1.0.1)
gherkin (>= 4.1.3)
cucumber-expressions (4.0.4)
cucumber-tag_expressions (1.0.1)
cucumber-wire (0.0.1)
data_magic (1.2)
faker (>= 1.1.2)
yml_reader (>= 0.6)
diff-lcs (1.3)
faker (1.8.4)
i18n (~> 0.5)
ffi (1.9.18)
gherkin (4.1.3)
i18n (0.9.0)
concurrent-ruby (~> 1.0)
multi_json (1.12.2)
multi_test (0.1.2)
page-object (2.2.4)
page_navigation (>= 0.10)
selenium-webdriver (~> 3.0)
watir (~> 6.8)
page_navigation (0.10)
data_magic (>= 0.22)
rake (12.2.1)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.0)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
rubyzip (1.2.1)
selenium-webdriver (3.6.0)
childprocess (~> 0.5)
rubyzip (~> 1.0)
watir (6.8.4)
selenium-webdriver (~> 3.4, >= 3.4.1)
yml_reader (0.7)
PLATFORMS
ruby
DEPENDENCIES
cucumber
data_magic
page-object (~> 2.0)
rake
rspec
watir
I am unsure why this error is occurring when I have Watir installed. When I require Watir and run the script just using the ruby file then it works ok. As soon as do the same using the Feature it errors.
When Any help would be greatly appreciated.
This isn't a direct answer to your question, but does apply to where you are trying to start the browser when running cucumber. Unless you want the overhead of starting up the browser for each scenario, I recommend starting up the browser in support/env.rb Then in the before hook you can just do something like clearing cookies to get the equivalent of a fresh browser for each scenario.
Otherwise if you are opening the browser at the start of each scenario, and closing it at the end your features will be much slower to execute just due to the time it takes to spin up the browser session for every single scenario.
In my Rails app, I've updated Ruby from 1.9.3 to 2.1.0. Now when I restart my tests I get an error:
NameError: uninitialized constant MiniTest::Unit::TestCase::SUPPORTS_INFO_SIGNAL
Here are gems in the Gemfile:
gem 'rails'
gem 'mysql2'
gem 'json'
gem 'jquery-rails'
gem 'kaminari'
gem 'therubyracer'
gem 'devise'
gem 'rak'
gem 'rails-translate-routes'
gem 'routes'
group :assets do
gem 'sass-rails', " ~> 3.2.3"
gem 'uglifier', ' >= 1.0.3'
end
group :development, :test do
gem 'factory_girl_rails'
end
group :test do
gem 'shoulda'
gem 'database_cleaner'
gem 'capybara'
end
Here's the stack trace:
`NameError: uninitialized constant MiniTest::Unit::TestCase::SUPPORTS_INFO_SIGNAL
~/.rvm/gems/ruby-2.1.0#kalender/gems/mocha-0.10.5/lib/mocha/integration/mini_test/version_230_to_262.rb:19:in `run'`
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit/testcase.rb:17:in `run'
~/.rvm/gems/ruby-2.1.0#kalender/gems/activesupport-3.2.12/lib/active_support/testing/setup_and_teardown.rb:36:in `block in run'
~/.rvm/gems/ruby-2.1.0#kalender/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:425:in `_run__4401979439353622961__setup__4295356768171603498__callbacks'
~/.rvm/gems/ruby-2.1.0#kalender/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
~/.rvm/gems/ruby-2.1.0#kalender/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
~/.rvm/gems/ruby-2.1.0#kalender/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
~/.rvm/gems/ruby-2.1.0#kalender/gems/activesupport-3.2.12/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:940:in `block in _run_suite'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:933:in `map'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:933:in `_run_suite'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:663:in `block in _run_suites'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:661:in `each'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:661:in `_run_suites'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:884:in `_run_anything'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1092:in `run_tests'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1079:in `block in _run'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1078:in `each'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1078:in `_run'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/minitest/unit.rb:1066:in `run'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:27:in `run'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:780:in `run'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:372:in `block (2 levels) in autorun'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:33:in `run_once'
~/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit.rb:371:in `block in autorun'
I just came across a bug that is similar or identical to this one and was able to resolve it locally. For me, I had a trace that begins with:
/home/youruser/.rvm/gems/ruby-2.1.0/gems/mocha-0.10.5/lib/mocha/integration/mini_test/version_230_to_262.rb:19:in `run': uninitialized constant MiniTest::Unit::TestCase::SUPPORTS_INFO_SIGNAL (NameError)
This shows that the error is actually occurring in mocha when it tries to reference a constant that has been removed from the version of minitest that likely came along with your Ruby upgrade.
For me, doing a bundle update mocha fixed the problem.
Doing a bit of code spelunking to figure out specifically where the problem was fixed, I used the "git pickaxe" (git log -SSUPPORTS_INFO_SIGNAL) on a cloned copy of the mocha repository, and it seems like this commit removed the reference to SUPPORTS_INFO_SIGNAL, so using anything after that commit in mocha should be ok.
If upgrading your version of mocha doesn't solve the problem, take a close look at the stack trace and you should see which library that depends minitest having SUPPORTS_INFO_SIGNAL defined is causing the error. Then look upstream in that dependency to see if this problem was fixed. If not, fork the dependency you're using that exhibits this behavior and push your own patch upstream.
I am using ubuntu 64-bit machine using, rvm, ruby 1.9.3-p448 , rails 3.2.13
And am not able to precompile assets.
I used following commands but got same error always :-
rake assets:precompile RAILS_ENV=production
rake assets:precompile
bundle exec rake assets:precompile
mymachine:~/mymachine-rails/prod$ bundle exec rake assets:precompile --trace
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails
4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See
the release notes for more on this:
http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released.
(called from at
/home/mymachine/mymachine-rails/prod/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails
4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See
the release notes for more on this:
http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released.
(called from at
/home/mymachine/mymachine-rails/prod/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails
4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See
the release notes for more on this:
http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released.
(called from at
/home/mymachine/mymachine-rails/prod/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails
4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See
the release notes for more on this:
http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released.
(called from at
/home/mymachine/mymachine-rails/prod/Rakefile:7)
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/mymachine/.rvm/rubies/ruby-1.9.3-p448/bin/ruby /home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks
assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks:14:in
read': No such file or directory - assets:precompile:all
(Errno::ENOENT)
from /home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks:14:in
'
rake aborted!
Command failed with status (1): [/home/mymachine/.rvm/rubies/ruby-1.9.3-p448/...]
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils.rb:55:in
block in create_shell_runner'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in
call'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in
sh'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:insh'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils.rb:82:in
ruby'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:inruby'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in ruby_rake_task'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:ininvoke_or_reboot_rake_task'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in block (2 levels) in <top (required)>'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:236:in
call'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:236:in
block in execute'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:231:in
each'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:231:in
execute'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:175:in
block in invoke_with_call_chain'
/home/mymachine/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:168:in
invoke_with_call_chain'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:161:in
invoke'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:149:in
invoke_task'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:106:in
block (2 levels) in top_level'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:106:in
each'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:106:in
block in top_level'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:115:in
run_with_threads'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:100:in
top_level'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:78:in
block in run'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:165:in
standard_exception_handling'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:75:in
run'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/bin/rake:33:in
<top (required)>'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/rake:19:inload'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/rake:19:in <main>'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks:14:in
eval'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks:14:in
`'
Tasks: TOP => assets:precompile
Gems List :-
*** LOCAL GEMS ***
actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
acts-as-taggable-on (2.4.1)
acts_as_paranoid (0.4.2)
angularjs-rails (1.0.7)
arel (3.0.2)
bcrypt-ruby (3.1.1)
browser (0.2.0)
builder (3.0.4)
bundler (1.3.5)
bundler-unload (1.0.2)
cancan (1.6.10)
chronic (0.9.1)
climate_control (0.0.3)
cocaine (0.5.1)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.3)
columnize (0.3.6)
commonjs (0.2.6)
couchrest (1.1.3)
couchrest_model (1.1.2)
daemons (1.1.9)
debugger (1.6.1)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.3)
devise (3.0.0)
em-synchrony (1.0.3)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (1.4.0)
executable-hooks (1.2.2)
faraday (0.8.7)
faye-websocket (0.6.2)
hashie (2.0.5)
hike (1.2.3)
hiredis (0.4.5)
httpauth (0.2.0)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (3.0.4)
jquery-ui-rails (4.0.4)
json (1.7.7)
jwt (0.1.8)
less (2.3.2)
less-rails (2.3.3)
libv8 (3.16.14.3 x86_64-linux, 3.11.8.17 x86_64-linux)
localtunnel (0.3)
magic_multi_connections (1.2.1)
mail (2.5.4)
masonry-rails (0.2.0)
mime-types (1.23)
mini_portile (0.5.1)
multi_json (1.7.7)
multipart-post (1.2.0)
mysql2 (0.3.13)
net-ssh (2.6.8)
net-ssh-gateway (1.2.0)
nokogiri (1.6.0)
oauth (0.4.7)
oauth2 (0.8.1)
omniauth (1.1.4)
omniauth-facebook (1.4.1)
omniauth-google-oauth2 (0.2.0)
omniauth-linkedin-oauth2 (0.0.2)
omniauth-oauth (1.0.1)
omniauth-oauth2 (1.1.1)
omniauth-twitter (1.0.0)
orm_adapter (0.4.0)
paperclip (3.5.0)
polyglot (0.3.3)
rack (1.4.5)
rack-cache (1.2)
rack-offline (0.6.4)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)
railties (3.2.13)
rake (10.1.0)
rb-readline (0.4.2)
rdoc (3.12.2)
redis (3.0.4)
ref (1.0.5)
rest-client (1.6.7)
rsolr (1.0.9)
rubygems-bundler (1.3.2)
rvm (1.11.3.8)
sass (3.2.9)
sass-rails (3.2.6)
sprockets (2.2.2)
swipe-rails (0.0.5)
therubyracer (0.12.0, 0.11.4)
thin (1.5.1)
thor (0.18.1)
tilt (1.4.1)
time_diff (0.3.0)
treetop (1.4.14)
twitter-bootstrap-rails (2.2.7)
tzinfo (0.3.37)
uglifier (2.1.2)
warden (1.2.3)
websocket-driver (0.2.1)
websocket-rails (0.4.9)
whenever (0.8.4)
will_paginate (3.0.4)
Seems to be an RVM quirk. I ran into this using rvm + ruby 2.0.0-p247 and this worked for me:
rvm ruby-2.0.0-p247#global do gem install executable-hooks
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Master:blog shaunstanislaus$ bundle update
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Enter your password to install the bundled RubyGems to your system:
Using rake (0.9.2.2)
Enter your password to install the bundled RubyGems to your system:
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
Using activemodel (3.2.6)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.6)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.6)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.6)
Using activeresource (3.2.6)
Using bson (1.6.4)
Using bson_ext (1.6.4)
Using bundler (1.1.5)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.4)
Using rdoc (3.12)
Using thor (0.15.4)
Using railties (3.2.6)
Using coffee-rails (3.2.2)
Using jquery-rails (2.0.2)
Using mongo (1.0.9)
Using will_paginate (3.0.3)
Using mongoid (2.0.0.beta.19)
Using rails (3.2.6)
Using sass (3.1.20)
Using sass-rails (3.2.5)
Using sqlite3 (1.3.6)
Using uglifier (1.2.7)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
Master:blog shaunstanislaus$ rails g mongoid:config
/Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configuration.rb:85:in
method_missing': undefined methodgenerators' for #
(NoMethodError)
from /Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.19/lib/mongoid/railtie.rb:13
from /Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.19/lib/mongoid.rb:89:in
require'
from /Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.19/lib/mongoid.rb:89
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in
require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in
require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in
each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in
require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in
each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in
require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler.rb:119:in
require'
from /Users/shaunstanislaus/Desktop/code/blog/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24:in
require'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24
from script/rails:6:inrequire'
from script/rails:6
how do i fix this?
i entered this command and error appears above.
Master:blog shaunstanislaus$ rails g mongoid:config
I have done trying to remove gemfile.loc
bundle install
rails g mongoid:config, came out this error again. still the same.
Master:blog shaunstanislaus$ rails g mongoid:config
/Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in require': /Library/Ruby/Gems/1.8/gems/mongoid-3.0.3/lib/mongoid.rb:148: odd number list for Hash (SyntaxError)
{ to: Config }))
^
/Library/Ruby/Gems/1.8/gems/mongoid-3.0.3/lib/mongoid.rb:148: syntax error, unexpected ':', expecting '}'
{ to: Config }))
^
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler.rb:119:in require'
from /Users/shaunstanislaus/Desktop/code/blog/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24:inrequire'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24
from script/rails:6:in `require'
from script/rails:6
Remove your GemFile.lock, run bundle install. If you're running on the latest version of Rails (3.2?) and Ruby (1.9.3-p###) it should work.
The reason the "generator" commands for Mongoid isn't showing is most likely that the gem didn't install properly for the version of rails and ruby you have.
Check this out: Rails g failing for mongoid commands… – Dominic Tancredi 2
I have this set up
ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]
bundle -v
Bundler version 1.1.5
bundle install succeeds; rake server still gives the error
/Users/avaranovich/.gem/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require': /Users/avaranovich/.gem/gems/mongoid-3.0.4/lib/mongoid.rb:148: odd number list for Hash (SyntaxError)
{ to: Config }))
I fixed this with typing bundle exec rails g mongoid:config
Hi I'm trying to run bundle install on my windows machine it runs fine until it reaches the linecache and then spits out a huge error:
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.3)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.3)
Using erubis (2.6.6)
Using rack (1.2.2)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.26)
Using actionpack (3.0.3)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.17)
Using actionmailer (3.0.3)
Using arel (2.0.9)
Using activerecord (3.0.3)
Using activeresource (3.0.3)
Using bundler (1.0.12)
Using thor (0.14.6)
Using railties (3.0.3)
Using rails (3.0.3)
Using render_component_vho (3.0.3)
Using verification (1.0.1)
Using active_scaffold_vho (3.0.19)
Using columnize (0.3.2)
Installing linecache (0.43) with native extensions C:/Ruby192/lib/ruby/site_ruby
/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR
: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
C:/Ruby192/bin/ruby.exe extconf.rb
Can't handle 1.9.x yet
*** 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:/Ruby192/bin/ruby
Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/linecache
-0.43 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/linecache-0.43/ext/gem_mak
e.out
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:511:in `b
lock in build_extensions'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `e
ach'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `b
uild_extensions'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:159:in `i
nstall'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/sour
ce.rb:96:in `install'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/inst
aller.rb:55:in `block in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/spec
_set.rb:12:in `block in each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/spec
_set.rb:12:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/spec
_set.rb:12:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/inst
aller.rb:44:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/inst
aller.rb:8:in `install'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/cli.
rb:225:in `install'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/vend
or/thor/task.rb:22:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/vend
or/thor/invocation.rb:118:in `invoke_task'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/vend
or/thor.rb:246:in `dispatch'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/vend
or/thor/base.rb:389:in `start'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/bin/bundle:13:in
`<top (required)>'
from C:/Ruby192/bin/bundle:19:in `load'
from C:/Ruby192/bin/bundle:19:in `<main>'
I've tried googling for the problem and found two posts that explain the problem that I have first is a Stackoveflow Post which is pretty close to what I've got, but upon further inspection I found that the solution given in that post was not what I needed
another is this post that seems to discuss the exact problem that I have but doesn't give a solution anyone have any idea what I should do??
Ruby Version => 1.9.2
Rails Version => oh come on it doesn't even tell rails version it just prints out another error
Could not find linecache-0.43 in any of the sources
Try running `bundle install`.
any ideas what I'm doing wrong?? any help would be immensely appreciated
You should try installing linecache19 instead of linecache. The gem you are trying to install is incompatible with Ruby version 1.9.2.
This is also suggested by the error message:
Can't handle 1.9.x yet
"debugger" gems has worked more flawless for me lately.
I switched from ruby-debug19 to debugger which installs the dependencies without any hassle.
1.9.2-p136 + RVM. Worked using ruby-debug19 which installs linecache19 as a dependency:
gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-p136/