I have a problem with rails console, here is what I am getting when I try to start rails console:
backo#speedy:~/ucimrails/simple_app$ rails c --sandbox
/home/backo/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in require': no such file to load -- test/unit/ui/console/testrunner (LoadError)
from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:inblock in require'
from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in load_dependency'
from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:inrequire'
from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/redgreen-1.2.2/lib/redgreen.rb:2:in <top (required)>'
from /home/backo/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:inrequire'
from /home/backo/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in block (2 levels) in require'
from /home/backo/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:ineach'
from /home/backo/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in block in require'
from /home/backo/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:ineach'
from /home/backo/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in require'
from /home/backo/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.1.4/lib/bundler.rb:119:inrequire'
from /home/backo/ucimrails/simple_app/config/application.rb:13:in <top (required)>'
from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/commands.rb:39:inrequire'
from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/commands.rb:39:in <top (required)>'
from script/rails:6:inrequire'
from script/rails:6:in `'
I located the problem is caused by redgreen gem. When I exclude it from Gemfile, console works again. But, can someone help me to make it working with redgreen gem? Interesting is that this is only happening on my netbok, when I work on my desktop computer all is fine with rails console.
Specifying in my Gemfile:
gem 'test-unit', '1.2.3'
...seems to work for me with 1.9.3 and Rails 3.2.8. It would, however, be nice to use this with a more recent version of test-unit (looks like 2.5.2 is the latest right now)...
The redgreen gem doesn't work with 1.9.2; for redgreen test output you might try
require 'test/unit'
require 'test/unit/ui/console/testrunner'
class Test::Unit::UI::Console::TestRunner
def guess_color_availability; true; end
end
in your test helper or so.
Related
I have looked at all the other post for questions like this an none of them seem to help, so i am thinking that maybe my case is a bit different? My problem is that i am trying to use selenium webdriver with rspec to start building automated tests for my site. I setup phantomjs and I am trying to run the following example code:
require "selenium-webdriver"
require 'rspec/expectations'
include RSpec::Matchers
def setup
#driver = Selenium::WebDriver.for :remote, url: 'http:/localhost:8001'
end
def teardown
#driver.quit
end
def run
setup
yield
teardown
end
run do
#driver.get 'http://the-internet.herokuapp.com'
expect(#driver.title).to eql 'The Internet'
end
the code runs without any issues when i just do ruby phatomjs_spec.rb. but when i try to run it with rspec phantomjs_spec.rb i get the following error:
ja:beta jw$ rspec ./spec/selenium/phantom_spec.rb
/Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require': cannot load such file -- selenium-webdriver (LoadError)
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /Applications/XAMPP/xamppfiles/htdocs/rl/web/beta/spec/spec_helper.rb:5:in `<top (required)>'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/configuration.rb:1181:in `require'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/configuration.rb:1181:in `block in requires='
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/configuration.rb:1181:in `each'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/configuration.rb:1181:in `requires='
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/configuration_options.rb:110:in `block in process_options_into'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/configuration_options.rb:109:in `each'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/configuration_options.rb:109:in `process_options_into'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/configuration_options.rb:22:in `configure'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/runner.rb:96:in `setup'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/runner.rb:85:in `run'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/runner.rb:70:in `run'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/lib/rspec/core/runner.rb:38:in `invoke'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-3.2.2/exe/rspec:4:in `<top (required)>'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/bin/rspec:19:in `load'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/bin/rspec:19:in `<main>'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/jw/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
here is the source of the example i was working on: http://elementalselenium.com/tips/46-headless-ghostdriver
I have tried using 1.3.1, 2.0 and the latest version of rspec without any success. Any ideas? Thanks in advance for your help!
I found the issue. The issue was that selenium-webdriver wasn't listed in the gemfile. I had installed it locally, that is why it was working with ruby but not rspec. Here is where i found the answer:https://github.com/louismullie/treat/issues/87
I have installed Jekyll on Windows 8 and created a new application. I am inside the directory and it gives me this error when I run jekyll serve
C:/Blog/> jekyll serve
C:/Ruby200/lib/ruby/gems/2.0.0/gems/safe_yaml-1.0.4/lib/safe_yaml/psych_resolver
.rb:4:in `<class:PsychResolver>': uninitialized constant Psych::Nodes (NameError
)
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/safe_yaml-1.0.4/lib/safe_yaml/p
sych_resolver.rb:2:in `<module:SafeYAML>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/safe_yaml-1.0.4/lib/safe_yaml/p
sych_resolver.rb:1:in `<top (required)>'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:69:in `require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:69:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/safe_yaml-1.0.4/lib/safe_yaml/l
oad.rb:131:in `<module:SafeYAML>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/safe_yaml-1.0.4/lib/safe_yaml/l
oad.rb:26:in `<top (required)>'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:69:in `require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:69:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll.rb:26:i
n `<top (required)>'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:69:in `require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:69:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-2.5.3/bin/jekyll:6:in `<
top (required)>'
from C:/Ruby200/bin/jekyll:23:in `load'
from C:/Ruby200/bin/jekyll:23:in `<main>'
Here is my _config.yml file
# Site settings
title: Your awesome title
email: your-email#domain.com
description: > # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://yourdomain.com" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll
# Build settings
markdown: kramdown
Thanks if anyone can help!
run gem cleanup it should solve the problem
This happened to me I fixed it by doing this:
First list your gems gem list
...
pg_search (0.7.9)
polyglot (0.3.5)
posix-spawn (0.3.10)
power_assert (0.2.2)
psych (2.0.5, 2.0.0)
pygments.rb (0.6.2)
rack (1.6.0)
rack-cache (1.2)
rack-protection (1.5.3)
...
Where you see psych, try using psych 2.0.5 gem uninstall psych -v 2.0.0
If you get an error message than uninstall gem 2.0.5 instead gem uninstall psych -v 2.0.5
Try Jekyll. This worked for me. You need to find the version of psych that interacts with your Ruby setup correctly. In my case was 2.0.0 but could be different for you.
Try bundle exec jekyll serve in some cases this will solve your issues.
I upgraded from rails 3.0.0 to 3.0.11 (don't want to move to 3.1 yet, for various reasons)
I changed the following in my Gemfile:
-gem 'rails', '3.0.0'
-gem 'mysql2', "0.2.6"
+gem 'rails', '3.0.11'
+gem 'mysql2', "~>0.2.7"
Fired up console and tried:
PopularMedia.where(:media_type => 1).all
and got this:
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'matcha_development.popular_media' doesn't exist: SELECT `popular_media`.* FROM `popular_media` WHERE `popular_media`.`id` = 1
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `query'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `block in execute'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract_adapter.rb:202:in `block in log'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.11/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract_adapter.rb:200:in `log'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `execute'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:586:in `select'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract/query_cache.rb:56:in `select_all'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/base.rb:473:in `find_by_sql'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/relation.rb:64:in `to_a'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/relation/finder_methods.rb:143:in `all'
from (irb):2
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails/commands/console.rb:44:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails/commands/console.rb:8:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Worked fine before, so what could possibly be the problem?
When I have issues like these, what I usually do is make a new project using the newer rails gem. This way, I can look at the Gemfile that is produced and compare it to the old one that I have and then proceed to update it accordingly.
Also, be sure to run bundle install after changing anything in your Gemfile.
If you forget, it can usually be the reason you are having the problem.
I hope that helps you fix your issue.
I am developing a RoR application on two different machines. The iMac works fine, and all Capistrano tasks work as expected. The macbook-pro, however, generates the following error for any cap task (even "cap -T")
luna:shootingstars sjf$ cap -T
/Users/sjf/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- Bundler/capistrano (LoadError)
from /Users/sjf/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:152:in `require'
from ./config/deploy.rb:30:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `load'
from Capfile:8:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/bin/cap:4:in `<top (required)>'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/bin/cap:19:in `load'
from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/bin/cap:19:in `<main>'
As near as I can tell, everything is set up the same on the two machines. The only difference I can find is that on the working machine...
sol:shootingstars sjf$ gem which bundler
/Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler.rb
while on the failing machine...
luna:shootingstars sjf$ gem which bundler
/Users/sjf/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler.rb
Note the "#global" in the ruby path.
Other than that, both machines are running
rvm version 1.10.2
ruby version 1.9.3p0
bundle version 1.0.21
capistrano version 2.9.0
rails version 3.2.1
Thanks for any help
Well, I finally figured out the answer to my own question. Turns out the Macbook Pro with the problem had "case sensitivity" turned on in the filesystem. "Mac OS Extended (Case-sensitive, Journaled)"
Changing the deploy.rb file line from...
require "Bundler/capistrano"
to
require "bundler/capistrano"
fixed the problem! (Yay!)
working in rails, and am trying the command 'rails g spree:site' as described in section 4.5 of the Spree getting Started Guide. not sure what the problem is, I am running rails 3.1.1.rc2 on a windows 7 platform. The error is below.
C:/Ruby192/lib/ruby/gems/1.9.1/gems/spree_auth-0.40.0/lib/spree_auth.rb:17:in `a
ctivate': uninitialized constant Devise::IndifferentHash (NameError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1.rc2/lib/act
ive_support/callbacks.rb:413:in `_run_prepare_callbacks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1.rc2/lib/act
ive_support/callbacks.rb:81:in `run_callbacks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.1.1.rc2/lib/action
_dispatch/middleware/reloader.rb:46:in `prepare!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication/finisher.rb:41:in `block in <module:Finisher>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:29:in `instance_exec'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:29:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:54:in `block in run_initializers'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:53:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/in
itializable.rb:53:in `run_initializers'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication.rb:96:in `initialize!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ra
iltie/configurable.rb:30:in `method_missing'
from C:/Users/Edu/RubymineProjects/myStore/config/environment.rb:5:in `<
top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/ap
plication.rb:83:in `require_environment!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/co
mmands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I had the same problem with rails 3.1. The solution was to put the following lines in my GEMFILE:
# ===:git with the repository's url that works=== #
gem 'spree', :git => 'git://github.com/spree/spree.git'
This should help in your case, too.
#jhsilva007 : Specifying this line ( gem 'spree', :git => 'git://github.com/spree/spree.git' )
definitely helped me resolving of error.
I think this line will get the latest version of the spree from github. What if I just want the particular version number of spree. I mean I don't like to get the beta version.