Stack level too deep upgrading to Rails 3 - ruby-on-rails

I'm upgrading an app to Rails 3 and have been going through it bit by bit, for example replacing all the old plugins with the relevant gems in the gemfile.
I seem to have got stuck however because now whenever I try to run the server I get this:
=> Booting WEBrick
=> Rails 3.0.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/rack-1.2.8/lib/rack/builder.rb:35: stack level too deep (SystemStackError)
I've been googling it for ages and have come to the conclusion that it is still because of one of the plugins, I just can't figure out which one. I have removed each one individually but none of them makes a difference.
I found these three similar questions but they don't really help me....
Stack level too deep error after running bundle update
SystemStackError at the rack level in Ruby 1.9.2, not 1.8.7
Stack level too deep trying to update from 3.0 to 3.1
My gemfile looks like this at the moment:
source 'https://rubygems.org'
gem "rails", "3.0.0"
#need to replace old acts_as_commentable vendor plugin
gem 'acts_as_commentable', '3.0.1'
gem "airbrake"
#need to add authlogic gem
gem 'authlogic', '~> 2.1.6'
gem "aws-s3"
gem "bj"
gem "bundler", "~> 1.0.0"
gem "calendar_date_select", "1.15"
gem "cancan", "1.2.0"
gem "carmen"
#replace plugin casein?
gem 'casein', '3.1.0'
gem 'comma', '0.4.1'
gem 'exifr'
# factory_girl 1.2.4 wasn't working with Rails 3 - consider an upgrade to factory_girl_rails?
# gem "factory_girl", "1.2.4"
gem 'fastercsv'
gem "geokit"
#need to replace above with below
gem 'geokit-rails'
gem "haml"
gem "hpricot"
gem 'hoptoad_notifier'
gem "jrails"
gem "libxml-ruby", "2.4.0"
gem "memcached", "~> 1.8.0"
#memcached no longer works?
gem 'dalli'
# Not sure why we have this if we're using SQLite3
gem "mysql2", "~> 0.2.6"
#TODO: changed by almazom
gem "rake", "0.8.4"
gem 'recurly'
gem "rdoc"
gem "rmagick"
gem "rspreedly"
gem "rubyzip"
gem 'sass'
# searchlogic not supported for rails3
# gem 'searchlogic'
gem 'rd_searchlogic', :require => 'searchlogic', :git => 'git://github.com/railsdog/searchlogic.git'
#need to use simplecov when upgrading to ruby 2 as rcov doesn't work
gem "simplecov"
gem 'sqlite3'
# tmail no longer included in rails 3?
gem 'tmail'
#need to upgrade will_paginate for casein...?
# gem "will_paginate", "2.3.16"
gem 'will_paginate', '3.0.4'
gem 'yaml_db'
group :development, :test do
gem 'test-unit', '1.2.3'
gem 'rspec', '1.3.2'
gem 'rspec-rails', '~> 1.3.4'
end
group :test do
gem 'capybara', '0.3.5'
gem 'cucumber', '1.1.2'
gem 'cucumber-rails', :git => "git://github.com/RKelln/cucumber-rails.git", :branch => "0.3.2-capybara-fix"
gem 'database_cleaner'
end
And the plugins I have are:
acts-as-favorite-updated
acts_as_configurable
acts_as_follower
better_logging
concerned_with
default_value_for
fast_context
fetcher
has_many_friends
jrails
paperclip
parallel_tests
rails_upgrade
yaml_db
Does anyone have any idea how I can deal with this issue?? :-(

Related

Bundler errors when bundling w/Rails 5.0.6 after upgrading from 4.2

Trying to upgrade Ruby 2.2/Rails 4.2 to Rails 5.0.6 (already gave up on 5.0.7.2 since it seems to require Zeitwerk which requires Ruby >= 2.4.4). The issue is I'm getting error messages about 25 gems from bundler that look similar to this:
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
premailer-rails was resolved to 1.11.1, which depends on
actionmailer (>= 3)
rails (= 5.0.6) was resolved to 5.0.6, which depends on
actionmailer (= 5.0.6)
Now, I've got gem "rails", '5.0.6' in my gem file and no listing for actionmailer. It seems that actionmailer 5.0.6 would satisfy both of those requirements, so why is bundler complaining (I did list actionmailer in the bundle update command)? More importantly, what can I do to get past this issue?
On a prior Rails upgrade, I removed the gemfile.lock and did a bundle install and did eventually get it working. So I tried that with this upgrade, only to get the same set of errors. I also tried bundle update --all and got the same errors.
Here's the Gemfile:
source 'http://rubygems.org'
ruby '2.2.10'
gem 'rails', '5.0.6'
gem 'railties', '5.0.6'
gem 'rake', '~> 10.4.2' # Version added when moving to RSpec 2.99
gem 'rack-cache', '1.5.1' # Added for 'rake', '~>10.4.2'
gem 'pg', '~> 0.15.0' # AR on 4.2 requires 0.15
# Note: must edit database.yml to include "host: local" and remove the username put there by "rails new <app> -db postgresql"
gem 'puma', '3.11.4'
gem 'rails_12factor', group: :production
gem 'sidekiq', '2.13.1', path: 'vendor/sidekiq/sidekiq-2.13.1'
gem 'sidekiq-pro', '1.2.2', path: 'vendor/sidekiq-pro/sidekiq-pro-1.2.2'
gem 'celluloid', '0.15.2' # Added when moving to Rails 4.0.13
gem 'redis', '3.3.3' # Added version when moving to Rails 4.0.13
gem 'redis-namespace', '1.5.2' # Added version when moving to Rails 4.0.13
gem 'connection_pool', '2.2.0' # Added when moving to Rails 4.0.13
# Need the following gems for sidekiq/web
gem 'slim'
# if you require 'sinatra' you get the DSL extended to Object
gem 'sinatra', :require => nil
gem 'minitest', '5.9.1' # Added when moving to Rails 4.1.16
gem 'jeff', '~>1.2' # Added when moving to Rails 4.1.16
gem 'excon', '0.22.1' # Added when moving to Rails 4.1.16
gem 'raindrops', '0.19.1' # Added when moving to Rails 4.1.16
gem 'sprockets-rails', '~> 2.0'
gem 'sprockets', '~> 2.8'
gem 'a2z', '0.1.2'
gem 'public_suffix', '1.5.3' # Added when moving to Rails 4.0.13
gem 'hitimes', '1.2.2' # Added when moving to Rails 4.0.13
gem 'ffi', '1.9.6' # Added when moving to Rails 4.0.13
gem 'faraday', '0.8.9' # Added when moving to Rails 4.0.13
gem 'net-http-persistent', '2.5.2' # Added when moving to Rails 4.0.13
gem 'platform-api', '2.1.0' # Added version when moving to Rails 4.0.13
gem 'json', '1.8.6' # Added version when moving to Rails 4.0.13
gem 'lograge'
gem 'oauth2', '0.9.4'
gem 'omniauth', '1.2.1'
gem 'omniauth-oauth2', '1.1.2'
gem 'omniauth-google-oauth2', '0.2.4' # Google OAuth-2 Login via OmniAuth
gem 'jwt', '1.0.0' # Added when moving to Rails 4.0.13
gem 'premailer-rails' # Converts CSS styles to inline styles, creates plain-text email from HTML email
gem 'premailer', '1.8.4' # Added version when moving to Rails 4.0.13
gem 'psych', '2.0.5'
gem 'stripe', '1.25.0', path: 'vendor/stripe/stripe-ruby-1.25.0'
gem 'sass-rails', '~> 5.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'uglifier', '>= 1.3.0'
gem 'mechanize', '2.7.2' # Added version when moving to Rails 4.0.13
gem 'nokogiri', '1.6.7.2' # Added version when moving to Rails 4.0.13
gem 'spreadsheet', '> 0.9.0'
gem 'roo', '2.5.1' # Added version when moving to Rails 4.0.13
gem 'roo-xls'
gem 'xml-simple'
gem 'rubyzip', '1.2.2' # Added version when moving to Rails 4.0.13
gem 'scbi_multi_gz_reader'
gem 'rmagick', '2.15.4' # Added version when moving to Rails 4.0.13
gem 'jquery-rails'
gem 'jquery-ui-rails'
# To use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.0'
gem 'will_paginate', '~> 3.0.0'
gem 'geoip'
gem 'byebug', '~> 10.0.0'
group :development do
gem 'web-console', '~> 2.0'
gem 'spring', '2.0.2'
end
group :test do
gem 'rspec-rails', '~> 3.1'
gem 'faker', '~> 0.3.1'
gem 'shoulda-matchers', '2.8.0' # Added version when moving to Rails 4.0.13
gem 'capybara' # Switched from Webrat to Capybara w/ Rails 4.2
gem 'factory_girl_rails', '4.7.0' # Added version when moving to Rails 4.0.13
gem 'timecop'
end
gem 'htmlentities'
gem 'retina_tag'
gem 'useragent'
Here's how I resolved this.
Remove versions from Gemfile for all gems (except Ruby and Rails).
Delete Gemfile.lock
Bundle install
In my case, I got a number of build errors on gems with native extensions. Most were related to a change to CLANG, the Mac OS X C compiler, requiring me to add -- --with-cflags="-Wno-error=implicit-function-declaration" to the gem install.

ERROR: Could not find a valid gem 'crypt19' (= 1.2.1) in any repository while running with rails 3.2.18

i am having ruby version ruby-1.9.3-p547 [ x86_64 ] which i am using for Rails 3.0.
Now i am having a project with rails version '2.3.18'. and ree-1.8.7-2012.02 [ x86_64 ].
bundle install and rake db:create is working fine and when I run rake db:migrate i am getting the following notice:
Missing these required gems:
crypt19 = 1.2.1
You're running:
ruby 1.8.7.374 at /usr/local/rvm/rubies/ree-1.8.7-2012.02/bin/ruby
rubygems 1.8.15 at /usr/local/rvm/gems/ree-1.8.7-2012.02#community_clean, /usr/local/rvm/gems/ree-1.8.7-2012.02#global
Run `rake gems:install` to install the missing gems.
And when I run the above command, i am getting error as:
ERROR: Could not find a valid gem 'crypt19' (= 1.2.1) in any repository
ERROR: Possible alternatives: crypt, crypt3, crypto, cryptor, cryptsy
and you can see in below Gemfile that i am comment crypt19.
My Gemfile:
source 'http://rubygems.org'
gem 'rails', '2.3.18'
gem 'sqlite3'
gem 'acts-as-taggable-on', '2.0.4'
gem 'acts_as_archive', '0.4.0'
gem 'acts_as_dropdown', '2.0.3'
gem 'also_migrate', '0.3.5'
gem 'axlsx', '1.3.5'
#gem 'crypt19', '1.2.1'
gem 'bitly', '0.5.1'
gem 'builder', '3.0.0'
gem 'capistrano', '2.5.18'
gem 'capistrano-ext', '1.2.1'
gem 'chronic', '0.3.0'
gem 'command-t', '1.2.1'
gem 'daemons', '1.0.10'
gem 'database_cleaner', '0.6.0'
gem 'diff-lcs', '1.1.2'
gem 'eventmachine', '0.12.10'
gem 'github-markup', '0.5.3'
gem 'hashie', '0.2.0'
gem 'hoe', '2.5.0'
gem 'hoptoad_notifier', '2.4.2'
gem 'htmlentities', '4.3.1'
gem 'httparty', '0.5.2'
gem 'i18n', '0.6.0'
gem 'json_pure', '1.4.6'
gem 'mail', '2.3.0'
gem 'memcache-client', '1.8.5'
# gem 'memcached', '0.19.7'
gem 'mime-types', '1.16'
gem 'mocha', '0.9.10'
gem 'mogli', '0.0.16'
gem 'money', '2.1.5'
gem 'mover', '0.3.6'
gem 'oauth', '0.4.7'
gem 'polyglot', '0.3.1'
gem 'pony', '1.3'
gem 'powder', '0.1.7'
gem 'prawn', '0.8.4'
gem 'prawn-core', '0.8.4'
gem 'prawn-layout', '0.8.4'
gem 'prawn-security', '0.8.4'
gem 'rack', '1.1.6'
gem 'rack-rewrite', '1.0.2'
gem 'rack-test', '0.5.6'
# gem 'rmagick', '2.13.1'
gem 'rspec', '1.3.1'
gem 'rspec-rails', '1.3.3'
gem 'ruby-hmac', '0.4.0'
gem 'rubyzip', '0.9.9'
gem 'rvm', '1.11.3.5'
gem 'thor', '0.14.6'
gem 'tzinfo', '0.3.16'
gem 'validatable', '1.6.7'
gem 'webrat', '0.7.2'
gem 'will_paginate', '2.2.2'
gem 'xml-simple', '1.0.12'
gem 'yajl-ruby', '0.7.8'
gem 'rake', '0.8.7'
Please pull me out of this issue.
As of February of 2013, the crypt19 gem vanished from rubygems. Although, the gem is still hosted on github, so you can specify manually the git repository from where to fetch the gem:
gem 'crypt19-rb', :git => 'https://github.com/coffeejunk/crypt19.git', :branch => 'master'
Also, make sure you specify the correct gem version to be used, since the above gem's version is 1.3.1, instead of 1.2.1 . In your environment.rb file, add the following line (or replace it with the good version):
config.gem 'crypt19-rb', :version => '1.3.1'
As to why the bundler tries to install your gem even though it's commented, I'm not sure I can explain. Perhaps it's because you're missing a space? But that's odd.

Migrating to rails 3.1 gives DEPRECATION WARNING: class_inheritable_attribute is deprecated

Since i migrated from Rails 3.0 to Rails 3.1 i get these warnings :
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please
use class_attribute method instead. Notice their behavior are slightly
different, so refer to class_attribute documentation first. (called
from require at
/Users/vincentdaubry/.rvm/gems/ruby-1.9.2-p318#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:74)
I do not have any reference to class_inheritable_attribute in my code.
I guess one of the gem i'm using is producing this error, but how can i know which one ? Or is there something else to do to fix this warning ?
EDIT 2 :
None of the gem i'm using has any reference to class_inheritable_attribute (i tried to ack "class_inheritable_attribute" in the gem directory).
If i deploy my app on another computer on rails 3.1.3 that doesn't use RVM i dont get the warning, so i think it comes from RVM. Does it sound reasonable ?
I tried to update RVM with rvm get stable but i still get the warning..
Any ideas ?
EDIT :
Here is my gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'paperclip', '2.4.5'
gem 'pdf-toolkit', '0.5.0'
gem 'omniauth-facebook', '1.2.0'
gem 'delayed_job', '2.1.4'
gem 'devise', '1.5.3'
gem 'mini_magick', '3.4'
gem 'faraday', '0.6.1' #WARNING : this faraday version is specify, because on 0.7.5 this breaks facebook connection
gem 'acts-as-taggable-on', '2.2.2'
gem 'kaminari', '0.13.0'
gem 'forem', :git => "git://github.com/radar/forem.git"
gem 'forem-redcarpet', :git => "git://github.com/radar/forem-redcarpet"
gem 's3_swf_upload', :git => 'https://github.com/nathancolgate/s3-swf-upload-plugin.git'
gem 'aws-s3', '0.6.2', :require => 'aws/s3'
gem 'jquery-rails', '1.0.13'
gem 'dalli', '1.1.4'
gem 'bson', '1.5.2'
gem 'bson_ext', '1.5.2'
gem 'exception_notification_rails3', '1.2.0', :require => 'exception_notifier'
######################################################################
# unused
######################################################################
#gem 'newrelic_rpm', '3.3.1'
#gem 'mongo', '1.5.2'
#gem 'mongoid', '2.4.0'
#gem "rdiscount"
######################################################################
# Environment specific
######################################################################
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'mocha'
end
group :production do
gem "pg"
end
Thanks,
Vincent
You can grep by code of all installed gems to find all entries of class_inheritable_attribute. When you find it, try to update it.
It's bundler depreacation. Try update bundler. So far it works well with bundler 1.0.22

Rails & Image Science: Permission denied

I've problem with SocialNews framework from NewsTrust.
I use Ruby 187, Rails 2.3.11, DevKit, Visual C++ 2008 EE on Windows XP, when I run ruby script/server then I got following error: http://pastebin.com/LpNDRqcg.
The gemfile:
source :gemcutter
gem "rails", "2.3.11"
gem "sqlite3-ruby", :require => "sqlite3"
gem "mysql"
gem "aws-s3" ,'0.6.2' #<--- if you use aws for image storage
gem "right_aws", '2.1.0' #<--- if you use aws for image storage
gem "bj", '1.0.1'
gem "crack", '0.1.6'
gem "feed-normalizer", '1.5.2'
gem "hashie", '0.1.8'
gem "highline", '1.4.0'
gem "hoe", '2.3.3'
gem "hpricot", '0.8.4'
gem "httparty", '0.4.3'
gem "image_science"
gem "json", '1.2.0'
gem "libxml-ruby", '2.0.6'
gem "newrelic_rpm", '2.14.1'
gem "nokogiri", '1.4.4'
gem "rake", '0.9.0'
gem "RedCloth", '4.2.2'
gem "rspec", '1.2.9'
gem "ruby-debug", '0.10.4'
gem "RubyInline", '3.9.0'
gem "twitter", '0.8.4'
gem "twitter_oauth", '0.3.2'
gem "unicode", '0.4.0'
gem "will_paginate", '2.3.15'
gem "xml-simple", '1.0.15'
gem "ZenTest", '4.3.0'
gem "rdoc"
gem "koala"
gem "riddle"
gem "ruby-openid",'2.0.4'
# bundler requires these gems in all environments
# gem "nokogiri", "1.4.2"
# gem "geokit"
group :development do
# bundler requires these gems in development
# gem "rails-footnotes"
end
group :test do
# bundler requires these gems while running tests
# gem "rspec"
# gem "faker"
end
Can anybody help me please? What I need to do? Thanks anyway..
By the way, how to convert ImageScience into Rmagick from this script (SocialNews framework)?
Create the folder C:\Documents and Settings\pije76\.ruby_inline. And your stack is ancient.

Rails [3.1.0.rc1] webrick freeze on http 500 error

since I installed rails 3.1.0, when some bugs occur, Webrick freezes for a couple of minutes when some bugs occur (not all bugs, apparently the 500 ones).
My gemfile looks like this:
source 'http://rubygems.org'
gem "rails", "3.1.0.rc1"
#Asset template engines
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
gem 'jquery-rails'
gem "simple-navigation"
gem 'ranked-model' #, :git => 'git#github.com:harvesthq/ranked-model.git'
gem 'formtastic'
gem 'validation_reflection'
gem "paperclip", "~> 2.3"
gem 'devise'
gem 'heroku'
gem "aws-s3"
gem "scoped_search"
gem "meta_search", :git => 'git://github.com/ernie/meta_search.git'
gem "kaminari"
group :production do
gem "pg", "~> 0.11.0"
gem 'therubyracer-heroku', '0.8.1.pre3'
gem 'exception_notification', :require => 'exception_notifier'
end
group :development, :test do
gem 'mysql2'
end
require 'csv'
I'm on Mac OS X 10.6.7.
Can anyone help me on this? Thanks,
Nicolas
Try using mongrel, or another dev server such as unicorn.
Just add it to your gemfile
gem 'mongrel'

Resources