The problem:
I have this gem that I am working on. While trying to install it locally to do some tests, rake install fails after building the gem. Rake suggested that I run gem install for the built gem to debug. Surprisingly, gem install pkg/my_gem-x.y.z.gem works like a charm!
Any idea why?
Some details:
rake version: 10.0.3
Gem created using bundler version: 1.2.1
Contents of gemspec:
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'my_gem/version'
Gem::Specification.new do |gem|
gem.name = "mygem"
gem.version = MyGem::VERSION
gem.authors = ["Omar Abdel-Wahab"]
gem.email = ["me#example.com"]
gem.description = %q{bla bla bla}
gem.summary = %q{bla bla bla}
gem.homepage = "http://github.com/foobar/"
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_dependency "rails", ">= 3.1"
gem.add_dependency "jquery-rails"
gem.add_dependency "twitter-bootstrap-rails", ">= 2.1.0"
gem.add_development_dependency "bundler", ">= 1.0.0"
gem.add_development_dependency "rspec", "~> 2.3"
gem.add_development_dependency "sqlite3-ruby"
end
Output from rake install:
~/Projects/Github/my_gem% rake -vt install
** Invoke install (first_time)
** Execute install
my_gem 0.0.1 built to pkg/my_gem-0.0.1.gem
rake aborted!
Couldn't install gem, run `gem install /Users/owahab/Projects/Github/my_gem/pkg/my_gem-0.0.1.gem' for more detailed output
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:68:in `install_gem'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:43:in `block in install'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/Users/owahab/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/bin/rake:19:in `load'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/bin/rake:19:in `<main>'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in `eval'
/Users/owahab/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => install
Output from rake build then gem install:
~/Projects/Github/rails_autocomplete% rake build && gem install pkg/my_gem-0.0.1.gem
my_gem 0.0.1 built to pkg/my_gem-0.0.1.gem
Successfully installed my_gem-0.0.1
1 gem installed
Installing ri documentation for my_gem-0.0.1...
Building YARD (yri) index for my_gem-0.0.1...
Installing RDoc documentation for my_gem-0.0.1...
Based on the comment thread on the question, it was a permission problem. Debugging Bundler's gem_helper.rb file revealed this:
ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Users/owahab/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.1/ci/Gemfile.no-rails
Some gems had been installed as root. Removing them solved the problem.
Related
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.
First time question here forgive me if I am not descriptive. Running Ruby 1.8.7 w/ rails 2.3.5 If I run any rails or rake task I get
/home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `setup': undefined method `name' for #<Array:0x7f45a2fe73a8> (NoMethodError)
from /home/mathew/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `map'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `each'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `map'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `setup'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:114:in `check'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:121
from /home/mathew/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /home/mathew/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/rubygems-bundler-1.4.2/lib/rubygems_executable_plugin.rb:4
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:50:in `call'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:50:in `run'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:49:in `each'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:49:in `run'
from /home/mathew/.rvm/gems/ruby-1.8.7-p374#wholesale/bin/ruby_executable_hooks:10
my gem list is:
*** LOCAL GEMS ***
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
atomic (1.1.14)
bcrypt-ruby (3.1.2)
bundler (1.3.5)
bundler-unload (1.0.2)
daemons (1.0.10)
delayed_job (2.0.4)
executable-hooks (1.2.6)
hpricot (0.8.4)
i18n (0.6.5, 0.5.0)
json (1.8.1)
minitest (4.7.5)
multi_json (1.8.2)
mysql (2.8.1)
nokogiri (1.4.1)
rack (1.5.2, 1.0.1)
rails (2.3.5)
rake (10.1.0, 0.9.2.2)
rdoc (4.0.1)
rubygems-bundler (1.4.2)
rubygems-update (2.1.10, 1.8.25)
rvm (1.11.3.8)
thread_safe (0.1.3)
tzinfo (0.3.38)
From what I have read bcrypt-ruby and bundler don't play nice together. So I tried to uninstall bundler and rubygems-bundler (because rubygems-bundler is in the error output) but they don't seem to be uninstalled when I run gem list :/ Any help would be appreciated. Thanks!
Seems duplicated with: Rails 2.3.14 not working and the answer there was: Remove bundle from global gemset
$ rvm #global
$ gem uninstall bundler
For those coming from a search engine: In my case, with rubygems 3.1.1 and bundler 2.1.0, the issue was still having rubygems-bundler installed.
Traceback (most recent call last):
6: from /Users/myuser/.rvm/gems/ruby-2.6.3#timing/bin/ruby_executable_hooks:10:in `<main>'
5: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `run'
4: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `each'
3: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:50:in `block in run'
2: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
1: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- rubygems-bundler/noexec (LoadError)
10: from /Users/myuser/.rvm/gems/ruby-2.6.3#timing/bin/ruby_executable_hooks:10:in `<main>'
9: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `run'
8: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `each'
7: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:50:in `block in run'
6: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
5: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:156:in `require'
4: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:168:in `rescue in require'
3: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:168:in `require'
2: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:131:in `<top (required)>'
1: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:124:in `check'
/Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:84:in `setup': undefined method `plain_specs' for #<Bundler::RubygemsIntegration:0x00007f90bf0cb3e8> (NoMethodError)
Looking into the situation, the readme has this to say:
Generally, this gem is not needed on RubyGems >= 2.2.0.
The solution was to remove that gem from the #global gemset:
rvm #global
gem uninstall rubygems-bundler
Not quite sure what's changed in my setup, running tests inside Sublime Text 2 was working until recently ... Now, when I run an Rspec test from within Sublime Text 2 I get the following error.
This looks to me like an RVM issue, since I created a gemset a while ago. Any ideas?
Here's the error:
/Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:31:in `block in setup': You have already activated spork 0.9.2, but your Gemfile requires spork 0.9.0. Using bundle exec may solve this. (Gem::LoadError)
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:17:in `setup'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.1.3/lib/bundler.rb:107:in `setup'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.1.3/lib/bundler/setup.rb:17:in `<top (required)>'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/brettsanders/rails_projects/sample_app/config/boot.rb:6:in `<top (required)>'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/brettsanders/rails_projects/sample_app/config/application.rb:1:in `<top (required)>'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/brettsanders/rails_projects/sample_app/config/environment.rb:2:in `<top (required)>'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/brettsanders/rails_projects/sample_app/spec/spec_helper.rb:8:in `block in <top (required)>'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork.rb:24:in `prefork'
from /Users/brettsanders/rails_projects/sample_app/spec/spec_helper.rb:6:in `<top (required)>'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/brettsanders/rails_projects/sample_app/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:in `run'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0#rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10:in `block in autorun'
[Finished in 0.8s with exit code 1]
Also,
Here's my Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.10.0'
gem 'guard-rspec', '0.5.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.2'
group :test do
gem 'capybara', '1.1.2'
gem 'rb-fsevent', '0.4.3.1', :require => false
gem 'growl', '1.0.3'
gem 'guard-spork', '0.3.2'
gem 'spork', '0.9.0'
end
group :production do
gem 'pg', '0.12.2'
end
# 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'
looks like you have 0.9.2 version installed and sublime text is trying to use that
either update the version of your spork in your GemFile to 0.9.2 or do
gem uninstall spork
You will be presented with options of which version to remove choose the one with 0.9.2
I am following the instructions of this question to install a gem from git.
When I try to do I checkout of the branch I get:
mari#Black:~/Documents/apn_on_rails$ git checkout -b rails3 remotes/origin/rails3
fatal: git checkout: branch rails3 already exists
I also tried these instructions to download the branch and that works fine. But I still cannot build the gem. I get:
mari#Black:~/Documents/apn_on_rails$ rake build --trace
rake aborted!
no such file to load -- gemstub
/home/mari/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/mari/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/mari/Documents/apn_on_rails/Rakefile:2:in `<top (required)>'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
I also tried rake gem but I get the same error. What can I do?
I am using rails 3 and ruby 1.9.2
possibly you already have rails3 branch. Check this with git branch.
If branch already exist try running same command without '-b'. It should work.
I fixed the problem by running gem build apn_on_rails.gemspec instead of rake build or rake gem as suggested in the instructions followed
Environment
Windows 7 64 bit
Ruby 1.8.7
Rails 3.0.0
pg AdminIII
PostgreSQL 9.0.3
Cygwin
Gemfile
http://i54.tinypic.com/27yzxv4.png
Database Config
http://i53.tinypic.com/288b7ma.png
Steps I have taken
I tried addding "gem 'postgres-pr', :require => 'pg'" to the gemfile
Have tried installing multiple variations of the postgres gem,
postgres-pr
pg
ruby-pg
I continually get this error when trying to run rake db:migrate
rake aborted!
no such file to load -- pg
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `each'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `require'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `each'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `require'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler.rb:120:in `require'
/home/Other/rails_projects/test_project/config/application.rb:7
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
/home/Other/rails_projects/test_project/Rakefile:4
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Been at this for a couple days, really need some help. Thanks in advance!
You need to specify the correct platform for the gem. In my Gemfile, I have:
group :development, :test do
gem 'pg', :platforms => :mingw
end
(The group is there because I deploy to a Unix box, where the platform is obviously different). I seem to remember that I also needed the DevKit for this to work.
You need to install pg and add to your Gemfile
gem 'pg'
You may need to upgrade your version of Rails to 3.0.1 - 3.0.9 and also run gem install pg. Then just for good measure re-run bundle install.