Upgrading rails / reloadable - ruby-on-rails

I have tried to upgrade my rails in order to deploy a old RoR app into Heroku,
Unfortunately I'm getting some errors and I have no clue how to fix this. It seems that include Reloadable from my model isn't working anymore:
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant Artist::Reloadable (NameError)
from /disk1/home/slugs/123146_6bfd10b_0628/mnt/app/models/artist.rb:2
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_or_load'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_on'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_dependency'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:in `load_application_classes'
... 23 levels...
My previous install was using RAILS_GEM_VERSION = '1.1.2'.

Have you tried deleting the include Reloadable

Reloaded has been deprecated for a long time. Check this out: http://weblog.rubyonrails.org/2006/8/11/reloading-revamped
The functionality you're looking for may now be automatically built into rails.

Related

Ruby1.8 Rails2.3 ./script/server producing error

I have been assigned a projected that was written in Ruby1.8 and Rails2.3. We can't upgrade at the moment. I have successfully installed ruby and rails and installed all needed gems for the project on a ubuntu machine. I have received success messages while installing everything.
However, when I run the command ./script/server I received the output:
/var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require': no such file to load -- sentry (MissingSourceFile)
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /home/robotmaster/Documents/Source/agile/config/initializers/sentry.rb:1
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load_without_new_constant_marking'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:622:in `load_application_initializers'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:621:in `each'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:621:in `load_application_initializers'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:176:in `process'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:113:in `send'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:113:in `run'
from /home/robotmaster/Documents/Source/agile/config/environment.rb:42
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/commands/server.rb:84
from ./script/server:4:in `require'
from ./script/server:4
I am new to the Rails and would appreciate any help with this error message. Thanks
The key to the issue is here:
sentry (MissingSourceFile)
I'm really not familiar with that particular file (and Rail 2.3 is several major revisions behind...) but it indicates to me that there's something incomplete about your Gem set.
gem update
This would be my first attempt. Verify that all of the referenced gems in your Gemfile are present on the system. If at all possible, I'd really look to upgrade to at least Rail 3, preferably 4.
EDIT:
Reading this again, why are you executing ./script/server? You should be executing:
rails s

Unable to migrate Ruby gems?

I am pretty new to rails. Trying to rake/migrate to a new server. Here is the error I am getting.
[~/rails_apps/baseforesight/config]# rake db:migrate --trace(in
/home/i****\/rails_apps\/baseforesight)
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)rake aborted!
uninitialized constant ActiveSupport::Dependencies::Mutex
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/ext/module.rb:36:in `const_missing'
/home/iftftv/ruby/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:55
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/iftftv/ruby/gems/gems/activesupport-2.3.5/lib/active_support.rb:56
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/iftftv/ruby/gems/gems/rails-2.3.5/lib/tasks/misc.rake:18
/home/iftftv/ruby/gems/gems/rails-2.3.5/lib/tasks/rails.rb:4:in `load'
/home/iftftv/ruby/gems/gems/rails-2.3.5/lib/tasks/rails.rb:4
/home/iftftv/ruby/gems/gems/rails-2.3.5/lib/tasks/rails.rb:4:in `each'
/home/iftftv/ruby/gems/gems/rails-2.3.5/lib/tasks/rails.rb:4
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/iftftv/rails_apps/baseforesight/Rakefile:10
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/li/rake/application.rb:495:in`raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:78:in `load_rakefile'
I need sort of a clue on where to start. Anything will be helpful.
Thank you.
According to this Stack Overflow answer, you need to upgrade Rails to 2.3.11.
This should be a fairly painless upgrade if my one upgrade experience was normal.

rails gem permissions problem (tabs on rails)

I'm having trouble running a gem, tabs on rails -v=1.3.2, in my rails 2.3.8 app. The gem is installed locally (Ubuntu 10.10) and I have config.gem "tabs_on_rails", :version=>"1.3.2" in environment.rb. This is the output I get when I run script/server:
loren#ubuntu:~/apps/medmentum$ script/server
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
no such file to load -- tabs_on_rails
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:164:in `process'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
/home/loren/apps/medmentum/config/environment.rb:11
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:84
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3
/var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:158:in `read': Permission denied - /var/lib/gems/1.8/gems/tabs_on_rails-1.3.2/rails/init.rb (Errno::EACCES)
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:158:in `evaluate_init_rb'
from /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:154:in `evaluate_init_rb'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:48:in `load'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:38:in `load_plugins'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:37:in `each'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:37:in `load_plugins'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:369:in `load_plugins'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:165:in `process'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
from /home/loren/apps/medmentum/config/environment.rb:11
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:84
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3
When I run rake gems:install, I get this:
Permission denied - /var/lib/gems/1.8/gems/tabs_on_rails-1.3.2/rails/init.rb
I navigated to the tabs_on_rails gem folder in the filesystem and all of the files are locked. According to the files' properties, I am not the owner and cannot change the permissions. All of my other local gems are accessible without permissions problems, so this is odd. Any help is very much appreciated!
The same error affected the release 2.0.0.pre.
I just released a maintenance version for the 1.3.x branch.
Please install it and let me know if it works.
$ gem install tabs_on_rails -v 1.3.3
Also, the next time consider opening a ticket.
I think I solved the problem, but this may be more of a band-aid than a permanent solution. I stumbled upon this line of code[1]:
$ sudo chmod -R a+r /var/lib/ruby/gems/1.8/gems
The problem is that the permissions have been improperly set by the gem's author, and this line of code supposedly corrects said permissions.
[1] http://blog.innerewut.de/2008/7/8/gem-permissions

What’s wrong with my local Rails environment?

There is a Rails application I started a full year ago. It’s a Rails 2.3 app.
Now, someone else has made remote changes (it’s on Github, sorry, but it’s private). And I have done
sudo gem update
that is, updated all my gems, including Rails (to 3).
Realizing this, I have done
rake:freeze:edge RELEASE=2.3.8
or whatever to make this release use that version of rails, hoping this was the solution.
however, no such luck so far.
I get errors trying to start the server, AND trying to run script/console (though it’s more successful).
Note that this exact application works just fine on EngineYard.
Server:
$ script/server
=> Booting Mongrel
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 45, col 3: `' (ArgumentError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:902:in `database_configuration'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:437:in `initialize_database'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:141:in `process'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
from /Users/ajh/Sites/PROJECT_NAME/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
from /Users/ajh/Sites/PROJECT_NAME/config/environment.rb:11
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/railties/lib/commands/server.rb:84
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3
Console:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in load':ArgumentError: syntax error on line 45, col 3:rai'
And when, in console, I try to use a defined model:
#mm = MyModel.find(:all)
NameError: uninitialized constant MyModel
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in load_missing_constant'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:inconst_missing'
from /Users/ajh/Sites/PROJECT_NAME/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
from (irb):1
I just had this error, and the problem turned out to be that I'd used a tab instead of a double-space in the database.yml file. Thought I'd mention it, in case others have the same trouble.
My database.yml had a stray end keyword. Cleaning up that file solved my problems. Thanks to Garrett for pointing me in the right direction!

testing devise with shoulda and machinist

I´d like to test my app with shoulda and machinist. I use the devise authentification gem.
I get following error:
$ ruby unit/page_test.rb
c:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be rem
oved on or after August 2010. Use #requirement
c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant Admins (N
ameError)
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
from c:/Users/Mattherick/Desktop/heimspiel/heimspiel_app/app/controllers/admins_controller.rb:1
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_or_load'
from c:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_on'
... 12 levels...
from ./unit/../test_helper.rb:2
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from unit/page_test.rb:1
Somebody an idea what´s wrong? If I don´t use devise my tests are okay.
And my second question: Does somebdoy has a good tutorial for increasing different roles in the devise gem? If I generate my own views and add a few attributes to my devise-model, they won´t be save in the database. I read the docu at github, but don´t really checked it.
mattherick

Resources