Error while running rake command - ruby-on-rails

I got this error:
git://github.com/rails/prototype-rails.git (at 4.2) is not yet checked out. Run `bundle install` first.
When I run this:
sudo rake crons:generate
From what does this come? And how can I solve this?
I have defined this in the gemfile:
gem 'prototype-rails', :github => 'rails/prototype-rails', :branch => '4.2'
Everything else works fine except for the cronjob.
This is the GemFile:
source 'http://rubygems.org'
gem 'rails', '4.2.0'
gem "airbrake"
#gem "mysql"
#gem 'mysql2', '~>0.3.7'
gem 'mysql2', '~>0.3.9'
gem 'fastercsv'
gem 'newrelic_rpm', :group => [:production, :staging]
gem "xml-simple", :require => "xmlsimple"
gem "will_paginate", "~> 3.0.0"
gem "json", '1.7.7'
gem "default_value_for"
gem "whenever"
gem 'charlock_holmes'
gem 'rails_autolink'
gem 'mocha'
gem 'daemons'
gem "paperclip", "~> 4.2"
gem 'thread_safe', '0.3.5'
gem 'web-console', '~> 2.1.2'
group :development do
gem 'capistrano'
gem 'capistrano-ext'
gem 'railroady'
end

Related

Couldn't find file 'bootstrap-transition'

Error message, when I open project: couldn't find file 'bootstrap-transition'
(in /home/ubuntu/workspace/app/assets/javascripts/w.js.coffee:3)
In file w.js.coffee line 3 is #= require bootstrap-transition.
Which gem do I need to download or what needs to be customized in a rails project?
Gem file:
source 'https://rubygems.org'
gem 'rails', '~>3.2.12'
gem 'mysql2', '0.3.13'
gem 'haml-rails'
gem 'haml-contrib'
gem 'jquery-rails', '~>2.0.2'
gem 'paperclip', '~>3.4.0'
# gem 'authlogic'
gem 'devise', '~>2.2.3'
gem 'devise-encryptable'
gem 'devise-async'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-vkontakte'
gem 'dynamic_form'
gem 'simple_form'
gem 'russian'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'will_paginate'
gem 'state_machine'
gem 'settingslogic'
gem 'meta_search'
# gem 'meta_where', '1.0.1' # -> Using Rails 3.1? You want to take a look at Squeel instead
gem 'squeel'
gem 'ancestry'
gem 'retina_tag'
gem 'strong_parameters'
gem 'role-rails'
gem 'dropzonejs-rails'
gem 'daemons'
gem 'delayed_paperclip'
# gem 'rufus-scheduler', '2.0.10'
gem 'whenever', :require => false
gem 'thinking-sphinx', '~>2.0.14'
# gem 'ts-delayed-delta', :require => 'thinking_sphinx/deltas/delayed_delta'
gem 'resque', :require => 'resque/server'
gem 'resque-scheduler', '2.0.1'
gem 'resque-retry'
gem 'redis-namespace', '1.3.0'
gem 'ts-resque-delta', '~>1.2.4'
gem 'RedCloth'
gem 'rails_autolink'
gem 'acts-as-taggable-on'
gem 'acts_as_list'
gem 'tzinfo'
# gem 'aws-s3', :require => 'aws/s3'
gem 'aws-sdk', '~> 1.5.7'
gem 'aws-ses', :require => 'aws/ses'
gem 'newrelic_rpm'
gem "airbrake"
gem 'draper'
gem 'redis-rails'
# gem 'robokassa', git: 'git://github.com/glebtv/robokassa.git'
gem 'rest-client'
gem 'asset_sync'
gem 'private_pub'
gem 'thin'
# gem 'emoji4rails'
gem 'rails_emoji'
gem 'rumoji', git: 'git://github.com/mwunsch/rumoji'
gem 'escape_utils'
gem 'cocoon'
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'compass-rails'
gem 'bootstrap-sass', '2.1.1.0'
gem 'therubyracer'
gem 'execjs'
gem 'uglifier', '>= 1.0.3'
gem 'oily_png'
# gem 'font-awesome-rails'
gem 'turbo-sprockets-rails3'
end
group :development, :test do
gem 'rspec-rails', '2.5.0'
gem 'factory_girl'
gem 'factory_girl_rails'
gem 'rails3-generators', '0.17.4'
gem 'timecop', '0.3.5'
gem 'quiet_assets'
gem 'capybara'
gem 'database_cleaner'
gem 'capybara-user_agent'
gem 'pry-byebug'
end
group :development do
gem 'capistrano', '~>2.15.4', require: false
gem 'capistrano-ext', require: false
gem 'rvm-capistrano', require: false
gem 'wirble'
# gem 'hirb'
gem 'git'
gem 'letter_opener'
gem 'rack-mini-profiler'
gem 'mailcatcher'
end
group :production do
gem 'unicorn'
end
gem 'tinymce-rails'
gem 'tinymce-rails-langs'
gem 'backup'
After installing gem bootstrap-sass restart server.

Access to Rails.application.routes.url_helpers in views missing after Rails upgrade

I am attempting to upgrade an application from Rails 2.3 to 3.2. The issue I am currently stuck with is that Rails.application.routes.url_helpers is missing in views.
So, for example, my routes.rb file contains (in part):
MyApp::Application.routes.draw do
resources :users
end
and running rake routes shows me that I have the following:
users GET /users(.:format) users#index
POST /users(.:format) users#create
However, when I try to use the users_path in a HAML view, such as in the following example:
- if logged_in?
%ul.nav
- if user_can?(:see_users?)
%li.users= link_to "Users", users_path
Then I get the following error:
undefined local variable or method `users_path' for #<#<Class:0x000001045eda80>:0x000001030f6bb8>
However, if the ApplicationController is changed to include:
include Rails.application.routes.url_helpers
then everything is okay. The question is, why is that helper not automatically available in the views after the upgrade?
Update: As requested in comment below, the Gemfile is:
source 'http://rubygems.org'
source 'http://gems.github.com'
gem 'rails', '3.2.13'
gem 'rake', '10.0.4'
gem 'haml', '3.1.4'
gem 'responders', '0.9.3'
gem 'inherited_resources', '1.4.0'
gem 'formtastic', '2.2.1'
# Note: validation_reflection coming from git for now as it has the fix for
# https://github.com/redinger/validation_reflection/pull/13 in it, while the
# current official 1.0.0 release does not have the fix. Can be changed back
# to a version number if 1.0.1 is released.
gem 'validation_reflection', :git => 'git://github.com/redinger/validation_reflection.git'
gem 'treetop'
gem 'authlogic', '3.1.2'
gem 'param_protected', '2.0.0'
gem 'chronic', '0.2.3'
gem 'amon', '0.12.0'
gem 'aws-sdk', '1.9.5'
gem 'paperclip', '3.4.1'
gem 'json', '~> 1.4.3'
gem 'airbrake', '~> 3.0.5'
gem 'bluecloth', '>= 2.0.0'
gem 'less'
gem 'therubyracer'
gem 'mysql'
gem 'rdoc'
gem 'thin', '1.3.1'
gem 'delayed_job', '3.0.5'
gem 'delayed_job_active_record'
gem 'will_paginate', '3.0.4'
gem 'newrelic_rpm'
gem 'tiny_mce'
gem 'geocoder'
gem 'safe_attributes'
group :development do
gem 'capistrano', "~> 2.13.5"
gem 'capistrano-ext'
gem 'rvm-capistrano'
gem 'ci_reporter', '1.6.5'
end
group :development, :test, :cucumber do
gem 'pry'
gem 'rspec', '1.3.2'
gem 'rspec-rails', '~> 1.3.0', :require => 'spec'
gem 'email_spec', '0.6.5'
gem 'seed-fu'
end
group :test do
gem 'mocha', '0.9.8'
gem 'machinist', '1.0.6'
gem 'faker', '0.3.1'
gem 'timecop', '0.3.5'
gem 'fakeweb', '1.3.0'
gem 'shoulda'
gem 'uuid', "~> 2.3.7" # MIT
end
group :cucumber do
gem "cucumber", "~> 1.1.0"
gem "cucumber-rails", "~> 0.3.2"
gem "capybara", "~> 1.1.1"
gem 'database_cleaner', "~> 0.5.0"
gem 'launchy'
gem 'uuid', "~> 2.3.7" # MIT
end

Heroku- Could not find paperclip-3.1.3 in any of the sources

This morning when I tried to update my website, heroku didn't let me push the app.
Here's the message I got.
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
Fetching git://github.com/drhenner/nifty-generators.git
Could not find paperclip-3.1.3 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
! [remote rejected] master -> master (pre-receive hook declined)
I don't have paperclip- 3.1.3 in my gem file. I'm not sure why it's looking for paperclip 3.1.3
Here's my gem file
source 'http://rubygems.org'
gem 'rails', '~> 3.2.6'
gem 'asset_sync'
group :assets do
gem 'uglifier', '>= 1.0.3'
end
gem 'sass-rails', " ~> 3.2.3"
gem "activemerchant", '~> 1.17.0' #, :lib => 'active_merchant'
gem 'authlogic', "3.0.3"
gem 'bluecloth', '~> 2.1.0'
gem 'cancan', '~> 1.6.7'
gem 'compass', '~> 0.12.rc.0'
gem 'compass-rails'
gem 'dalli', '~> 1.1.5'
gem "friendly_id", "~> 3.3"
gem 'haml', ">= 3.0.13"#, ">= 3.0.4"#, "2.2.21"#,
gem "jquery-rails"
gem 'aws-sdk'
group :production do
gem 'pg'
gem 'thin'
end
gem 'nested_set', '~> 1.6.3'
gem 'nokogiri', '~> 1.5.0'
gem 'paperclip', '~> 3.0'
gem 'prawn', '~> 0.12.0'
gem 'rails3-generators', '~> 0.17.0'
gem 'rmagick', :require => 'RMagick'
gem 'rake', '~> 0.9.2'
gem 'state_machine', '~> 1.1.2'
gem 'sunspot_solr'
gem 'sunspot_rails', '~> 1.3.0rc'
gem 'will_paginate', '~> 3.0.0'
gem 'dynamic_form'
group :development do
gem 'sqlite3'
gem "autotest-rails-pure"
gem "rails-erd"
gem "ruby-debug19"
end
group :test, :development do
gem "rspec-rails", "~> 2.8.0"
gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
gem 'launchy'
gem 'database_cleaner'
end
group :test do
gem 'factory_girl', "~> 3.3.0"
gem 'factory_girl_rails', "~> 3.3.0"
gem 'mocha', '~> 0.10.0', :require => false
gem 'rspec-rails-mocha'
gem "rspec", "~> 2.8.0"
gem "rspec-core", "~> 2.8.0"
gem "rspec-expectations", "~> 2.8.0"
gem "rspec-mocks", "~> 2.8.0"
gem 'email_spec'
gem "faker"
gem "autotest", '~> 4.4.6'
gem "autotest-rails-pure"
gem "autotest-growl"
gem "ZenTest", '4.6.2'
end
Version 3.1.3 of Paperclip was "yanked" for some reason. You can see this on the RubyGems page for that version. Obviously your Gemfile was bundled during the brief period this Gem was available.
Version 3.1.4 was it's immediate replacement, if you do not wish to upgrade to the latest version (3.3.1).
To use this you should update your Gemfile to read:
gem 'paperclip', '~> 3.1.4'
Run bundle update paperclip after editing the Gemfile.
"I don't have paperclip- 3.1.3 in my gem file. I'm not sure why it's looking for paperclip 3.1.3"
~>3.0 is like saying >=3.0 and <4.0. Hence 3.1.3 is valid. The relevant documentation is available on the Bundler website.

bundle install circular dependencies

The following console logs should describe the issue
bundle install
Could not find multi_json-1.1.0 in any of the sources
Run `bundle install` to install missing gems.
bundle install asks me to bundle install.
Have tried: https://github.com/mpapis/rubygems-bundler/issues/4
Looked at: https://github.com/carlhuda/bundler/issues/865
Not sure where to go next.
Also of interest, if we comment all the gems from inside vendor/gems the bundle works fine.
source 'http://rubygems.org'
gem 'rails', '~> 3.2.2'
gem 'mysql2'
gem 'thin'
# Asset template engines
gem 'coffee-script'
gem 'uglifier'
gem 'sprockets'
gem 'less-js'
gem 'execjs'
gem 'nokogiri'
gem 'lucy'
gem 'babilu'
gem 'simple_form'
gem 'mechanize'
gem 'geoip'
gem 'less'
gem 'bb-ruby'
gem 'client_side_validations', "~> 3.2.0.beta.2"
gem 'client_side_validations-simple_form'
gem 'require_all'
#for avatars
gem 'paperclip'
gem 'rmagick'
gem "multipart-post"
gem 'gibberish'
# Memcached client
gem 'dalli'
#to support tables without auto-incrementing primary keys
gem 'composite_primary_keys', "~> 5.0.1"
gem 'calendar_helper', :require => 'calendar_helper'
gem 'jquery-rails'
gem 'capistrano'
gem 'capistrano-ext'
gem 'simple_form'
gem 'htmlentities'
gem 'will_paginate'
gem 'airbrake', :path => "vendor/gems/airbrake"
gem "uservoice", :path => "vendor/gems/uservoice"
# For spambots
gem "honeypot-captcha"
# Internationalization GUI
gem "tolk", :git => "http://github.com/miloops/tolk.git", :branch => "rails31"
gem "will-paginate-i18n"
gem "omniauth"
gem "omniauth-facebook"
gem "omniauth-justintv", :git => 'http://github.com/themindoverall/omniauth-justintv.git'
gem 'oauth'
gem 'rails-i18n'
# For rate limiting
gem "rack-throttle", :path => "vendor/gems/rack-throttle"
gem "xfire-api", :path => "vendor/gems/xfire-api"
gem "anametrix", :path => "vendor/gems/anametrix"
#To make ruby debug work see: http://stackoverflow.com/questions/6438116/rails-with-ruby-debugger-throw-symbol-not-found-ruby-current-thread-loaderro
group :development, :test do
#gem 'ruby-debug-base19', '0.11.26', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/ruby-debug-base19-0.11.26/"
#gem 'linecache19', '0.5.13', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/linecache19-0.5.13/"
#gem 'ruby-debug19', :require => 'ruby-debug'
gem 'ruby_parser'
end
group :test do
gem 'ruby-prof'
gem 'test-unit' # For performance testing
gem 'turn', :require => false
gem 'factory_girl_rails', "~> 1.0.1"
gem 'capybara', "~> 1.0.0"
gem 'database_cleaner', '~> 0.6.7'
gem 'rspec-rails', "~> 2.6.1"
gem 'cucumber-rails', "~> 1.0.0"
gem 'webrat', "~> 0.7.3"
gem 'autotest'
gem 'simplecov'
gem 'autotest-rails-pure'
gem 'simplecov', :require => false, :group => :test
gem 'spork'
end
group :production do
gem 'rack-google_analytics', :require => "rack/google_analytics"
end
Have you declared that gem in your Gemfile? Sometimes it helps to specify a specific version as you've done for some:
gem 'multi-json', '1.1.0'
If anyone turns out to be stuck on this what turned out to be the answer is one of our homegrown gems:
gem "xfire-api", :path => "vendor/gems/xfire-api"
had a require in it provided by a gem that was not specified in the gemspec. If you're stuck on this and have homegrown gems take a look through all your requires and makes sure all the files are provided by gems you specify in the Gemspec.

Rspec with rails 3.1 gives DEPRECATION WARNING ActiveRecord::Associations::AssociationCollection is deprecated?

I upgraded to rails 3.1 and I have some problems with my tests now that worked perfectly before.
I get the following warning before the tests:
DEPRECATION WARNING: ActiveRecord::Associations::AssociationCollection is deprecated! Use ActiveRecord::Associations::CollectionProxy instead. (called from at /home/user/rails_projects/project/config/environment.rb:5)
How can I use CollectionProxy instead of AssociationCollection?
Here is my Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.1.0'
gem 'jquery-rails'
gem "therubyracer", "~> 0.9.4"
gem 'carrierwave', '0.5.6'
gem 'haml', '~>3.1.2'
gem 'mysql2', '0.3.7'
gem 'rmagick', '2.13.1'
gem 'sitemap_generator', '2.0.1'
gem 'whenever', '0.6.8', :require => false
gem 'will_paginate', '3.0.pre2'
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
group :development do
gem 'rspec-rails', '2.6.1'
gem 'annotate-models', '1.0.4'
gem 'faker', '0.9.5', :require => false
gem 'ruby-debug19', '0.11.6'
end
group :test do
gem 'rspec-rails', '2.6.1'
gem 'webrat', '0.7.3'
gem 'factory_girl_rails', '1.0'
gem 'spork', '~> 0.9.0.rc'
end
This is my environment.rb:
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Project::Application.initialize!
Thank you!
I had the same problem and fixed it by upgrading to the latest version of will_paginate. So, change this: gem 'will_paginate', '3.0.pre2'
to this: gem "will_paginate", "~> 3.0.2"
Save your Gemfile then do bundle install.

Resources