When I run annotate at the command-line, I get the following error:
$ annotate
/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks': undefined method `task' for #<MyApp::Application:0x00000102e03b90> (NoMethodError)
from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
from Rakefile:8:in `<top (required)>'
from /.rvm/gems/ruby-1.9.2-p0/gems/annotate-2.4.0/lib/annotate.rb:17:in `load'
from /.rvm/gems/ruby-1.9.2-p0/gems/annotate-2.4.0/lib/annotate.rb:17:in `load_tasks'
from /.rvm/gems/ruby-1.9.2-p0/gems/annotate-2.4.0/bin/annotate:66:in `<top (required)>'
from /.rvm/gems/ruby-1.9.2-p0/bin/annotate:19:in `load'
from /.rvm/gems/ruby-1.9.2-p0/bin/annotate:19:in `<main>'
This is what my Gemfile looks like:
source 'http://rubygems.org'
gem 'rails'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'will_paginate', '3.0.pre2'
gem 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git'
gem 'mime-types', :require => 'mime/types'
gem 'rails3-generators'
gem 'devise', '~> 1.1.3'
gem 'devise_invitable', '~> 0.3.4'
gem 'declarative_authorization', :git => 'git://github.com/stffn/declarative_authorization.git'
gem 'aasm'
gem 'braintree'
#For voting
gem 'thumbs_up'
# For In-Place-Editing
gem 'best_in_place'
#For slugs for the plans
gem "friendly_id", "~> 3.2"
gem 'aws-s3'
group :development do
# Server
gem 'thin'
gem 'annotate-models', '1.0.4'
#gem 'rails-erd'
gem 'annotate'
gem 'faker', '0.3.1'
gem 'ruby_parser'
end
This is all on my localhost btw.
Marcamillion, it probably broke because at one stage you had rake 0.9.0 installed, which broke a lot of things for a lot of people without deprecating methods or warning people. When you ran bundle update, it would have installed rake 0.9.2 which fixed this. Hope this helps someone else.
I've solved this problem using gem 'annotate', ">=2.5.0".
I'm using ruby 1.9.2p320 and Rails 3.2.13.
Related
I'm not actually a ruby dev, I'm just trying to get development environment setup from a project and I'm having a world of trouble getting the gems in order so I can load up the server. I do mostly front-end work. Anyways, my error is:
There was an error while trying to load the gem 'ahoy_matey'.
Gem Load Error is: undefined method `hours' for 4:Fixnum
I've been searching google for last two days and can't come across anyone experiencing this issue with "ahoy_matey" gem. I get this error when trying to launch the server or rake migrations.
Ruby 1.9.3
Rails 3.2.13
mysql2 0.3.17
Any help is appreciated.
Full trace:
Bundler::GemRequireError: There was an error while trying to load the gem 'ahoy_matey'.
Gem Load Error is: undefined method `hours' for 4:Fixnum
Backtrace for gem load error is:
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy.rb:43:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy.rb:39:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy_matey.rb:1:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy_matey.rb:1:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:86:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `block in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler.rb:102:in `require'
/home/sirtastic/projects/dataraptor/config/application.rb:7:in `'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `require'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:689:in `raw_load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:94:in `block in load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:93:in `load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:77:in `block in run'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:75:in `run'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/bin/rake:33:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/rake:23:in `load'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/rake:23:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `eval'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `'
Bundler Error Backtrace:
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:90:in `rescue in block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:85:in `block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `block in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler.rb:102:in `require'
/home/sirtastic/projects/dataraptor/config/application.rb:7:in `'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `require'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `eval'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `'
(See full trace by running task with --trace)
source 'http://rubygems.org'
gem 'rails', '3.2.13'
gem 'mysql2'#, '~> 0.3.11'
gem 'sass-rails', '~> 3.2.3' # Because SCSS is compiled for embedded quoters
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'execjs', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails', '~> 3.0.4'
gem 'jquery-ui-rails', '~> 4.0.5'
gem 'jquery_datepicker'
group :production do
gem 'pry', require:false
end
group :development, :test do
gem 'capybara', :require => false
gem 'database_cleaner', :require => false # for use with capybara tests
gem 'factory_girl', '~> 4.1' # for generating test models
gem 'factory_girl_rails', require:false
gem 'forgery' # for generating test data
gem 'pry'
gem 'pry_debug'
gem 'pry-nav'
gem 'spork-rails', platform: [:mswin, :mingw] # Fast rpsec testing on Windows
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :development do
gem 'thin' # Sane development server
gem 'bullet' # for identifying areas to speed up database queries
gem 'meta_request' # for chrome rails-panel
gem 'rack-mini-profiler', require:false
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :test do
gem 'launchy', :require => false
gem 'rspec-rails'
gem "selenium-webdriver", "~> 2.40.0" # for AJAX testing
gem 'shoulda', :require => false
gem 'simplecov', :require => false # Test coverage
gem 'timecop'
gem 'vcr', '~> 2.9.3'#'~> 2.5.0'
gem "webmock", '~> 1.10.2'
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :dev, :release, :development do
gem 'better_errors'
gem 'binding_of_caller' # supports better errors by providing IDE in browser when error occurs
end
gem 'activeuuid', '>= 0.5.0'
gem 'ahoy_matey', '1.1.0' #needs this exact version in order to output UUIDs consistently. the next version after does not.
gem 'american_date' # by default, dates are parsed/formatted with American style
gem 'angularjs-rails', '~> 1.0.7'
gem 'attr_encrypted', '~> 1.2' # encrypt activerecord attributes in db
gem 'authlogic', '~> 3.2' # user login
gem 'aws-sdk'
gem 'capistrano', require: false# deployment of application
gem 'capistrano-ext', require: false
gem 'carrierwave' # file upload solution
gem 'daemons' # used for running delayed_job jobs
gem 'encryptor', '~> 1.1' # handle encryption of ActiveRecord fields
gem 'exception_notification', '~> 4.0.0'
gem 'faraday' # REST client for interfacing with external APIs
gem 'faraday_middleware'
gem 'fog', '~> 1.22' # for Amazon Web Services cloud storage
gem 'formatador', '~> 0.2' # This shouldn't need to be here. It is/was a dependency for fog-core, but it wasn't getting bundled (for some reason), so raking assets:precompile consistently failed. 2014-09-17.
gem 'haml', '~> 4.0.3'
gem 'holidays', '~> 2.1.0'
gem 'httpi', '~> 2.2.7'
gem 'json', '~> 1.8.1' # Specified so as to 'safely' conduct an update for the sake of stripe gem (2014-05-21)
gem 'liquid', '~> 2.5.0' # rendering templates, such as Marketing::Email::Template
gem 'mini_magick' # photo resizing
gem 'momentjs-rails'
gem 'multi_xml'
gem 'paperclip', '~> 3.5.0' # handle file attachments to activerecord
gem "paypal-recurring"
gem 'nested_form'
gem 'rails3-jquery-autocomplete'# supports autocomplete fields
gem 'redis' # for publishing
gem 'remotipart', '~> 1.0' # enables multipart form submissions over ajax
gem 'ruby-saml', '~> 1.0.0'
gem 'rvm-capistrano', require: false # for deploying to servers where multiple rubies are available
gem 'safe_attributes' # takes care of attribute name collisions w/ ActiveRecord (we use 'delay')
gem 'savon', '~> 2.7'
gem "select2-rails" # makes an autocomplete select box, compatible with x-editable
gem 'sidekiq', '~> 2.17.0' # handles background/delayed jobs
gem 'spreadsheet', require: false
gem "stripe", '~> 1.11.0'
gem 'tinymce-rails', '>= 4.0.8' # version 4.0.8 includes important bug fixes
gem 'transaction_retry' # Catch mysql deadlock and try again
gem 'tzip', '~> 0.0.4' # Find timezone by zip code
gem 'whenever', require: false # handles scheduled tasks
gem 'wicked_pdf' # creates pdfs from html (is a wrapper for wkhtmltopdf)
gem 'will_paginate', '~> 3.0' # paginates index pages for activerecord
gem 'wkhtmltopdf-binary' # the backend linux tool that creates pdfs from html using QT Webkit rendering engine
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
Looks like you might be requiring your bundle before requiring rails. If you have these two lines in your application.rb file, they need to be in this order:
require 'rails/all'
Bundler.require(:default, Rails.env)
So I see you're running just rails s. I know this question is old but maybe this might help someone else. So the command you want to be running is:
bundle exec rails s
bundle exec executes a command in the context of the bundle.
This command executes the command, making all gems specified in the Gemfile available to require in Rails.
Essentially, if you would normally have run something like rspec spec/my_spec.rb, and you want to use the gems specified in the Gemfile and installed via bundle install, you should run bundle exec rspec spec/my_spec.rb.
Note that bundle exec does not require that an executable is available on your shell's $PATH.
Source
When I run RAILS_ENV=development rails s my app works fine. But when I run RAILS_ENV=production rails s I get the message:
christophecompaq#ubuntu:~/FunkyApp$ RAILS_ENV=production rails s
DEPRECATION WARNING: require "activerecord" is deprecated and will be removed in Rails 3. Use require "active_record" instead. (called from /usr/lib/ruby/vendor_ruby/activerecord.rb:2)
=> Booting WEBrick
=> Rails 3.2.3 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/var/lib/gems/1.8/gems/omniauth-1.1.0/lib/omniauth/strategy.rb:136:in `initialize': Received wrong number of arguments. [nil] (ArgumentError)
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `new'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `build'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `build'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:282:in `inject'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `each'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `inject'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `build'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:470:in `build_middleware_stack'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application/finisher.rb:31
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/christophecompaq/FunkyApp/config/environment.rb:5
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /home/christophecompaq/FunkyApp/config.ru:4
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /home/christophecompaq/FunkyApp/config.ru:1:in `new'
from /home/christophecompaq/FunkyApp/config.ru:1
christophecompaq#ubuntu:~/FunkyApp$
With my limited Rails knowledge, I think I figure it out right when I say there's a problem with the omniauth gem - strategy.rb, line 136, specifically.
But I've never, ever, changed anything in my var/lib/gems folder. And when I compare my strategy.rb against the one on github: https://github.com/intridea/omniauth/blob/v1.1.0/lib/omniauth/strategy.rb#L124 I get the exact same file - even the formatting is identical.
I have backups of my app and even when I go into those backup folders and do RAILS_ENV=production rails s I get the exact same error message - which would lead me to believe it's some core dependency/gem file issue, not some configuration/deploy thing I accidentlly changed in my app folder. (although I'm probably wrong!...) Everything was working fine up to about 3 weeks ago - no rails s errors at all
I'm just throwing ideas out there, but something maybe in .bashrc, .bash_profile?...I don't know. Any help would be appreciated!
Edit: adding my gemfile, below:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'rake', '~> 10.0.4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2', '~> 0.3.11'
gem 'json', '~> 1.7.3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'compass-rails', '~> 1.0.1'
gem 'bootstrap-sass', '~> 2.0.2'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', '~> 0.10.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'jquery-fileupload-rails'
end
gem 'jquery-rails', '~> 2.0.2'
gem 'inherited_resources', '~> 1.3.1'
gem 'simple_form', '~> 2.0.2'
gem 'will_paginate', '~> 3.0.3'
gem 'bootstrap-will_paginate', '~> 0.0.7'
gem 'has_scope', '~> 0.5.1'
gem "best_in_place", "~> 1.1.2"
gem 'devise', '~> 2.0.4'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'linkedin'
gem 'omnicontacts', '~> 0.2.3'
gem 'SystemTimer', '~> 1.2.3'
gem 'resque', '~> 1.20.0'
gem 'resque-scheduler', :require => 'resque_scheduler'
gem 'rest-client', '~> 1.6.7'
gem 'rest-graph', '~> 2.0.1'
gem 'geokit', '=1.6.5'
gem 'geokit-rails3', '~> 0.1.5'
gem 'memcache-client'
gem 'forgery', '~> 0.5.0'
gem 'factory_girl_rails', '~> 1.7.0'
gem "amoeba", "~> 1.2.1"
# 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 'ruby-debug'
group :development do
gem 'mongrel'
gem 'pry-rails'
gem 'quiet_assets'
gem 'email_spec'
gem 'capistrano', '~> 2.12.0'
gem 'capistrano-ext', '~> 1.2.1'
gem 'rvm-capistrano', '~> 1.2.1'
gem 'ruby-debug-base', '=0.10.4'
gem 'ruby-debug', '=0.10.4'
gem 'annotate'
gem 'letter_opener', :git => 'https://github.com/ryanb/letter_opener.git'
gem 'localtunnel'
end
group :test do
gem 'cucumber-rails', '~> 1.3.0', :require => false
gem 'capybara-webkit', '~> 0.11.0'
gem 'headless', '~> 0.3.1'
gem 'database_cleaner', '~> 0.7.2'
gem 'rspec-rails', '~> 2.9.0'
gem 'email_spec'
end
You could set the environment using bin/rails db:environment:set RAILS_ENV=production
I installed clearance and followed the last steps which were "rails generate clearance:install". However rails server does not start up for me when I try to open in terminal.
/Users/lexi87/areyoutaken/config/initializers/clearance.rb:4:in `block in <top (required)>': uninitialized constant Clearance::PasswordStrategies::BCrypt (NameError)
from /Users/lexi87/.rvm/gems/ruby-1.9.3-p374/gems/clearance-0.16.3/lib/clearance/configuration.rb:36:in `configure'
from /Users/lexi87/areyoutaken/config/initializers/clearance.rb:1:in `<top (required)>'
from /Users/lexi87/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.12/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
Here's my Gemfile and I have bcrypt gem inside.
source 'https://rubygems.org'
gem 'rails', '3.2.12'
gem 'bootstrap-sass', '2.1'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'jquery-rails', '2.0.2'
gem 'annotate', '2.5.0'
gem 'clearance'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
gem 'guard-rspec', '1.2.1'
gem 'guard-spork', '1.4.2'
gem 'spork', '0.9.2'
gem 'rb-fsevent', '~> 0.9.1'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '4.1.0'
gem 'cucumber-rails', '1.2.1', :require => false
gem 'database_cleaner', '0.7.0'
# gem 'launchy', '2.1.0'
# gem 'rb-fsevent', '0.9.1', :require => false
gem 'growl', '1.0.3'
end
group :production do
gem 'pg', '0.12.2'
end
Any help would be greatly appreciated.
You appear to be running gem version 0.16.3 of clearance, which doesn't support the Clearance::PasswordStrategies::BCrypt password strategy. If you upgrade to v1.0.0.rc1 or higher than that should work.
The only supported password strategies in 0.16.3 are Clearance::PasswordStrategies::Blowfish and Clearance::PasswordStrategies::SHA1.
If you want to try a version that supports BCrypt, you can update your Gemfile to say:
gem 'clearance', :git => "git://github.com/thoughtbot/clearance.git", :tag => "v1.0.0.rc4"
That will pull a specific tag of that repository. You can leave off the :tag to grab the latest version from GitHub. Keep in mind, that it may not be as stable as 0.16.3.
Trying to start the server and I'm getting this:
/Users/Ross/.rvm/gems/ruby-1.9.2-p180#webapp/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': no such file to load -- addressable/uri (LoadError)
from /Users/Ross/.rvm/gems/ruby-1.9.2-p180#webapp/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
from /Users/Ross/.rvm/gems/ruby-1.9.2-p180#webapp/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /Users/Ross/.rvm/gems/ruby-1.9.2-p180#webapp/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/Ross/.rvm/gems/ruby-1.9.2-p180#webapp/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/Ross/.rvm/gems/ruby-1.9.2-p180#webapp/gems/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /Users/Ross/.rvm/gems/ruby-1.9.2-p180#webapp/gems/ruby/1.9.1/gems/faraday-0.7.5/lib/faraday/connection.rb:1:in `<top (required)>'
I've tried a number of versions, deleting the Gemfile.lock, updating the bundler, etc. I've searched a lot of the threads around and it there looks to be a conflict between OmniAuth and devise but not with my error. Version conflict? How do you diagnose?
Here's my Gemfile:
source 'http://rubygems.org'
require 'rubygems'
gem 'rails'
gem 'actionpack'
gem 'jquery-rails'
gem 'haml'
gem "devise", :git => "https://github.com/plataformatec/devise.git"
# gem 'oa-core'
gem 'omniauth'
gem 'omniauth-openid'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-github'
gem "settingslogic"
gem 'composite_primary_keys'
gem 'addressable'
# gem 'faraday'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'squeel'
gem 'sqlite3'
gem 'mysql2', '~> 0.2.6'
gem "bcrypt-ruby", :require => "bcrypt"
group :development, :test do
gem 'rspec-rails'
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'hpricot', :require => false #html2haml
gem 'ruby_parser', :require => false # html2haml
gem 'pickle'
gem 'awesome_print', :require => 'ap'
gem 'factory_girl_rails'
end
group :development do
gem 'heroku', :require => false
gem 'sass'
end
group :test do
gem 'shoulda'
gem 'cucumber-rails'
gem 'spork', '~> 0.9.0.rc3'
gem 'guard-spork'
gem 'database_cleaner'
end
It actually was a ownership issue the dependent gem was installed as root. I updated the ownership all the directories and files in the gems directory and it worked. If you have a problem installing (i.e. generate native code) a gem where you sudo it, remember to go back and change the ownership of files back in the gems directory back to your user account
I've reviewed the questions that seem to be relevant to my problem, and I can't find a solution. When I try to run the tests in a Rails 3.0.3 App, I get this error:
willmac:signalkit wbarrett$ rake test
(in /Users/wbarrett/Sites/signalkit)
LOADING CONFIG/ENVIRONMENT.RB
./test/unit/authentication_test.rb:3: uninitialized constant ActiveSupport (NameError)
from /Users/wbarrett/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
from /Users/wbarrett/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
from /Users/wbarrett/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
from /Users/wbarrett/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
./test/functional/authentications_controller_test.rb:3: uninitialized constant ActionController (NameError)
from /Users/wbarrett/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
from /Users/wbarrett/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
from /Users/wbarrett/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
from /Users/wbarrett/.rvm/gems/ree-1.8.7-2011.03#global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
Errors running test:units, test:functionals!
As you can see, the tests are requiring test_helper and requiring environment.rb (I added the LOADING.. output to the top of the environment.rb config file)
Here's my Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'devise'
gem 'unicorn'
gem 'omniauth', :git => 'git://github.com/signalkit/omniauth.git', :branch => 'signalkit'
gem 'mongrel'
# gem 'tinder'
gem 'oauth2', :git => 'git://github.com/signalkit/oauth2.git', :branch => 'signalkit' #0.1.1 with modification for Basecamp
gem 'crack'
gem 'delayed_job'
gem "builder", "2.1.2"
gem "haml", "3.0.12"
gem "maruku", "0.6.0"
gem "RedCloth", "4.2.2"
gem "sinatra", "1.1.0", :require => "sinatra/base"
gem "monkeywrench"
gem "httparty"
gem "hoptoad_notifier"
group :test do
gem "shoulda", "~> 2.11.3"
gem "mocha", "~> 0.9.12"
gem "webmock", "= 0.7.3"
gem "test-unit"
end
What's wrong with this picture? Thanks all!
UPDATE: 6/30/2011 4:05PM CST
For whatever reason, changing the require at the top of all the test files from
require 'test_helper'
to
require File.dirname(__FILE__) + '/../test_helper'
solved my problem. +25 to whoever can tell me why this is, since the helper was being loaded fine the other way as well.