First time rails install, help with gems/rake - ruby-on-rails

I just did a first time ruby enterprise edition, installed some gems, and now I'm trying to do a
' sudo ./rake gems:install' and getting a:
rake aborted!
No Rakefile found
error. Firstly, what directory should I be doing this from?
Here are the steps I've followed:
download ruby enterprise from http://www.rubyenterpriseedition.com/download.html
wget http://rubyforge.org/frs/download.php/68719/ruby-enterprise-1.8.7-2010.01.tar.gz
./ruby-enterprise-X.X.X/installer
/opt/ruby-enterprise-1.8.7-2010.01/bin/gem install mysql
ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/gem /usr/bin/gem
ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/rake /usr/bin/rake
and I've installed several gems
I have found the appropriate directory (I think), and am still getting errors. Here's a copy of rake with --trace:
dan#dev:~/myApp.com-ror$ rake --trace gems:install
(in /home/dan/myApp.com-ror)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
rake aborted!
No such file or directory - /home/dan/myApp.com-ror/config/database.yml
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:902:in `read'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:902:in `database_configuration'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:437:in `initialize_database'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:141:in `process'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
/home/dan/songness.com-ror/config/environment.rb:14
/home/dan/Languages/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/home/dan/Languages/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/home/dan/Languages/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/gems.rake:17
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/home/dan/Languages/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/home/dan/Languages/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/dan/Languages/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
And what should database.yml look like?

rake gems:install is to install gems for your app. You have to run this inside your app root directory. To install gems on your machine use gem install.

If you have not set your path up correctly then you will need to run this from the rails directory.

Ok I've looked in the docs
$ /opt/ruby-enterprise-X.X.X/bin/gem install rails
in your case means just:
gem install rails
When you mentioned ' sudo ./rake gems:install' what were you trying to achieve?
Once installed rails do:
rails myproject
And there you go.

Presuming you're not using bundler or can't (due to your ruby/rails version)...
Below, I'm avoiding the sudo prepend because RoR is no longer the sole realm of linux users. Windows users using gitbash as our low level console for administering our Rails apps in the local development environment will not need sudo, nor will it work in our development environment. FTR, if you don't know what sudo is, it means "super user do", a leftover from unix and so an intrinsic part of the linux vernacular. If you need to do things in linux that require privilege, you'll probably need sudo to gain those rights (or you'll need to assign direct super user status to yourself for particular actions....sometimes sudo isn't enough!). If you need privilege in windows, you probably have already logged into windows with administrative rights.. In any case, if you're new to Ruby on Rails and are confounded by the term, just ignore it for now. You don't need it, although you probably will at some point when you start interacting with hosting services, which often run within a linux framework...
Anyway, getting back to the matter at hand...
gem install (some gem name) (ex: gem install tinyMCE) installs a copy to your local Ruby development environment. That is, think of it as installing a library component you can call on later. In general, it does nothing to our application on its own.
But if you want to use a gem (a second source enhancement package, ex: tinyMCE, a popular rich text editor enhancement) then the gem will need to be installed directly to your application, or said another way, you'll need to bind a transportable copy to the application AFTER installing it to your rails development environment, whetherr modifying an existing application or creating a new one.
If you're still puzzled, suppose I say it this way
you create an application like "My_special_blog". The action Rails My_special_blog creates the basic plumbing, but it doesn't write the content, nor does it automatically install tinyMCE so you can use it, even though you may have installed it to your development system (using gem install tinyMCE ), ie, your RUBY installation. Gems are an easy way of adding functionality like the aforementioned rich text editor
And that's exactly what rake:gems install does. It uses your application's environment.rb file (in the My_special_blog/config subdirectory btw) to determine which gems are wanted for use by the application, then it installs them to the application (literally, in subdirectories off the My_special_blog/vendors directory from the local development environment.
The important thing is that when you run rake:gems install, you need to do so from the "root" of your application, ie, from the My_special_blog directory. Not the ruby directory, not My_special_blog/config, just My_special_blog (as an example application name)
As a leader for you to do a bit of googling...Version and source location can be specified in the environment.rb's config.gem statements that define which gems you're going to use.
Hope this helps someone, who like me, is often confounded by terse answers that presume one is already expert enough that the question wouldn't have been asked in the first place...
If you look at environment.rb, it should have an entry like this
Rails::Initializer.run do |config|
end
it's inside that initializer that you place gem config statements. For instance, let's say you wanted to add the clearance gem and you needed v0.5.3 and the gem was located at gems.github.com...and you also wanted mislav-will paginate, the syntax might look a bit like this:
Rails::Initializer.run do |config|
config.gem "thoughtbot-clearance",
:lib => 'clearance',
:source => 'http://gems.github.com',
:version => '0.5.3'
config 'mislav-will_paginate',
:version => '~> 2.3.8',
:lib => 'will_paginate',
:source => 'http://gems.github.com'
end
without those statements, rake:gems install won't load local copies of those gems to your application's vendor/gems folder.

Related

How do I run specs for the activeadmin gem

I am trying to run the specs for a local clone of the activeadmin gems current master.
I am using ruby 2.2.2 and have bundled successfully.
When I try to run one of the specs like so:
bundle exec rspec spec/unit/filters/humanized_spec.rb
I am getting the following error:
The git source https://github.com/jruby/activerecord-jdbc-adapter is not yet checked out. Please run `bundle install` before trying to start your application
Coverage report generated for RSpec to /Users/aljoscha/gem/activeadmin/coverage. 0.0 / 0.0 LOC (100.0%) covered.
/Users/aljoscha/gem/activeadmin/spec/rails_helper.rb:13:in `require': cannot load such file -- active_record (LoadError)
from /Users/aljoscha/gem/activeadmin/spec/rails_helper.rb:13:in `<top (required)>'
from /Users/aljoscha/gem/activeadmin/spec/unit/filters/humanized_spec.rb:1:in `require'
from /Users/aljoscha/gem/activeadmin/spec/unit/filters/humanized_spec.rb:1:in `<top (required)>'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1435:in `load'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1435:in `block in load_spec_files'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1433:in `each'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1433:in `load_spec_files'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:100:in `setup'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:86:in `run'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:71:in `run'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:45:in `invoke'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/rspec-core-3.5.4/exe/rspec:4:in `<top (required)>'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/bin/rspec:22:in `load'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/bin/rspec:22:in `<main>'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
from /Users/aljoscha/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'
which I cannot make sense of.
Especially since activerecord-jdbc-adapter is not even in the Gemfile.
What am I missing?
Try prepending your command with bundle exec:
bundle exec rspec spec/unit/filters/humanized_spec.rb
It looks like you have a local version discrepancy causing issues.
If not, did you follow all of the steps listed on their contributing readme?
If you are still stuck, you may be experiencing an issue with bundler itself. First, try updating bundler then reinstalling gems and attempt to run rspec. If that doesn't work you may need to delete the bundle cache folder and start over.
I'm going to re-answer to emphasize how to test a gem using appraisal as mentioned in CONTIBUTING:
bundle exec appraisal install
bundle exec appraisal rails_50 rspec spec/unit/filters/humanized_spec.rb
Thank you for your interest in Active Admin.

Ruby on Rails (Errno::EACCES)

I am getting the following error whenever I type any command on all my rails applications. I working on a virtual machine in cloud 9. Any idea or guidance?
(master) $ bundle exec rspec spec/
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `read': Permission denied - /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/specifications/multi_json-1.8.4.gemspec (Errno::EACCES)
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `load'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:269:in `block (2 levels) in _all'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:268:in `each'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:268:in `block in _all'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:267:in `each'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:267:in `_all'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:410:in `each'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:216:in `find_all'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:216:in `matching_specs'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:238:in `to_specs'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:256:in `to_spec'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems.rb:1231:in `gem'
from /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/bin/bundle:22:in `<main>'
It sounds like your gems were installed with sudo access, which your current user (web runner?) lack the right perms to see the Ruby install dir.
I can't quite say why the gems were installed to a path like /usr/libexec/openshift/cartridges — perhaps this is part of your cloud host's setup?
Do you boot your own rails server out of your instance? e.g. like you installed Unicorn, nginx, etc. on your own? If so, you can use rbenv to install a ruby and gemset to a local path over which you have full permission control.
If you don't have scenario #1 above, then the setup may be misconfigured by the host, and you should open a ticket.

Rails rspec issues (cannot load such file --b (LoadError))

I'm following Hartl's guide to Ruby on Rails, and I'm currently trying to set up "guard" and "spork" for automating "rspec" testing. When I try to run
bundle exec rspec spec/requests/static_pages_spec.rb
I get the following errors:
/home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `require': cannot load such file -- b (LoadError)
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `block in requires='
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `map'
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `requires='
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:20:in `block in configure'
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:19:in `each'
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:19:in `configure'
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:21:in `run'
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
from /home/throne/.rvm/gems/ruby-1.9.3-p392#rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
I looked at other solutions for people who had similar kinds of problems (things like reinstalling gems, using absolute paths and fixing do / end statements in the target file), but none of them seemed to even change the issue. Thanks for any help!
Rewrite your Gemfile. Change 'selenium-webdriver' to '~> 2.35.1', reinstall bundle and everything has to be OK!
I had same error when tried to run test with single dash in params (need to run with --rdb).
This page came up when I was researching the same problem using the same tutorial. After some added investigation, I discovered that I was typing only a single dash on the --drb option. With a single dash rspec enables debugging and tries to require the file 'b'. Very different from connecting to a DRb server :-

I get a pg error when trying to destroy a controller

I work on windows, have rails 3.2.12(just upgraded) and ruby 2.0.0p0. when i try to delete a controller i get this error:
F:\my apps\meshworks-redo> rails d controller Plans
C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1-x86-mingw32/lib/pg.rb:10:in `require': cannot load such file -- 2.0/pg_ext (LoadError)
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1-x86-mingw32/lib/pg.rb:10:in `rescue in <top (required)>'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1-x86-mingw32/lib/pg.rb:3:in `<top (required)>'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:72:in `require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:70:in `each'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:70:in `block in require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:59:in `each'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:59:in `require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler.rb:132:in `require'
from F:/my apps/meshworks-redo/config/application.rb:7:in `<top (required)>'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:24:in `require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:24:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I tried re installing the pg gem, no luck.
A friend of mine got the same problem when using Ruby 2.0 on Windows 7 with Postgres. It occurs not only when trying to destroy a controller, but for every database action (including rake db:create). The problem is that the pg_ext.so file is not included for ruby 2.0. It is included for 1.9, but simply copying this to the 2.0 does not seem work. However, I found another method to obtain the correct pg_ext.so. Not exactly sure why this works, but it works for him. Here is what you need to do:
Go to the folder where 2.0/pg_ext.so (the file that could not be found) should be located. In your case C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1-x86-mingw32/lib/.
Create a folder called '2.0' (without the quotes) here.
In this folder you will need the correct pg_ext.so file. You can obtain this in the following way:
Manually install the pg gem ("gem install pg" in console). This installs the non x86-mingw32 version of the gem. It does not fix the problem, but it does create the correct pg_ext.so. I think this is because it compiles the pg gem for your system, so for ruby 2.0. You can then use this pg_ext.so file with the pg x86-mingw32 version. You will need DevKit in order to compile and install pg (http://rubyinstaller.org/add-ons/devkit/).
Go to the location of pg_ext.so in the pg-0.14.1 gem folder. In your case this would be C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1/lib.
Copy the file pg_ext.so from this folder to the newly pg-0.14.1-x86-mingw32/lib/2.0/ folder in step 2.
Now retry your commands and check if everything works. If it does not, delete your Gemfile.lock and re-run bundle install.
The same problem with this gem might occur with other mingw32 gems as well. IFor example, I had the same problem with the bcrypt-rails gem. Following the same steps as described above fixed the problem. I am now successfully running Ruby 2.0 on Windows 7.
Ps. If you have any other problems running the pg gem on Windows 7 64 bit, then try to install the 32 bit x86 version of Ruby (the RubyInstaller) and postgresql. Furthermore, make sure you include the Ruby folders in your path (this is an option while installing ruby 2.0 using the RubyInstaller) as well as the Postgresql lib and bin folders.
Good luck!

Rspec stops working suddenly because of `require': no such file to load

Rspec has been running fine for a while but then I suddenly encounter this issue when running any rspec tests:
/Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:437:in `require': no such file to load -- rspec/instafail (LoadError)
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:437:in `block in requires='
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:435:in `map'
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:435:in `requires='
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:20:in `block in configure'
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:19:in `each'
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:19:in `configure'
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:21:in `run'
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:66:in `rescue in run'
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:62:in `run'
from /Users/joseph/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
I usually have a couple of checkouts of my project (i.e. git clone twice into separate directories). For some reason rspec would encounter this issue only in one of my checkouts and not the other even when using the same version of the code. I eventually circumvented the issue by creating another clone. This issue has popped up again for some reason, and I don't want to have to keep creating clones to avoid the issue. Does anyone know what might be the root cause?
Turns out the issue was gems like rspec-instafail were grouped as a development gem. At some point in the past I had run 'bundle install --without development' and apparently subsequent bundle installs are done with that option automatically. As a result, those gems weren't on my $LOAD_PATH.
To fix it, I just ran 'bundle install --without asdf' and since there isn't an 'asdf' group it installed all the gems. There's probably a more appropriate option to re-add those groups, but this worked for me.

Resources