Unable to migrate Ruby gems? - ruby-on-rails

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.

Related

Incompatible library versions ruby, rvm, bundler

I am having troubles with Ruby using rvm. First I thought problem was with specific gem pg. But now I was able to reproduce error using mysql2. I have troubles to diagnose the problem...
Here is the last log.
bundle exec rake secret
rake aborted!
LoadError: incompatible library version - /home/dominim6/ror/dapps/releases/20160315195705/vendor/bundle/ruby/2.2.0/gems/mysql2-0.3.20/lib/mysql2/mysql2.so
/home/dominim6/ror/dapps/releases/20160315195705/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/home/dominim6/ror/dapps/releases/20160315195705/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/home/dominim6/ror/dapps/releases/20160315195705/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/dominim6/ror/dapps/releases/20160315195705/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/home/dominim6/ror/dapps/releases/20160315195705/vendor/bundle/ruby/2.2.0/gems/mysql2-0.3.20/lib/mysql2.rb:31:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.2.3#424_dapps/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
/usr/local/rvm/gems/ruby-2.2.3#424_dapps/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
/usr/local/rvm/gems/ruby-2.2.3#424_dapps/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
/usr/local/rvm/gems/ruby-2.2.3#424_dapps/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
/usr/local/rvm/gems/ruby-2.2.3#424_dapps/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
/usr/local/rvm/gems/ruby-2.2.3#424_dapps/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
/usr/local/rvm/gems/ruby-2.2.3#424_dapps/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
/home/dominim6/ror/dapps/releases/20160315195705/config/application.rb:7:in `<top (required)>'
/home/dominim6/ror/dapps/releases/20160315195705/Rakefile:4:in `require'
/home/dominim6/ror/dapps/releases/20160315195705/Rakefile:4:in `<top (required)>'
Why does it search for 2.2.0 here? Why not 2.2.3? (which, by the way, is not installed under vendor)
/home/dominim6/ror/dapps/releases/20160315195705/vendor/bundle/ruby/2.2.0/gems/mysql2-0.3.20/lib/mysql2.rb:31:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.2.3#424_dapps/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
Similar case, I believe, is this other question about pg. I had that trouble, that is why I tested now with mysql. I even created a bug at ruby, which was rejected because is a mix of library extensions...
Question is what is mixing libraries. My guess is rvm. Any similar cases? Any help to diagnose? I can put more info using both pg and mysql2.

I get error after using rails new command

I get error after I use rails new command-
Pareshs-MacBook-Pro:Desktop psghodge$ rails new lynda_cms
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/options.rb:32:in `default_options': undefined method `write_inheritable_attribute' for Rails::Generator::Base:Class (NoMethodError)
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/base.rb:90:in `<class:Base>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/base.rb:85:in `<module:Generator>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/base.rb:48:in `<module:Rails>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/base.rb:6:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator.rb:34:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/bin/rails:14:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/rails:23:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/rails:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Judging by your error, you're trying to use Rails v2.3.5 with ruby 2.0.0. Without doing a lot of googling I can't be certain, but I'm fairly sure that old versions of Rails like that only work with ruby 1.8.7.
Unless you have a really good reason to use a version of Rails that old, you shouldn't do it.
Use a new Rails, or if you have to use that Rails then install ruby 1.8.7

"rails server" not working, sqlite3_native symbol not found

I'm getting this error message when I try the "rails server" command... not really sure what's going on?
/Library/Ruby/Gems/1.8/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle: dlsym(0x1010621e0, Init_sqlite3_native): symbol not found - /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle (LoadError)
from /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.5/lib/sqlite3.rb:6
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /Users/grace/Documents/web_stuff/tutorbookrails/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:52:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:52
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:49
from script/rails:6:in `require'
from script/rails:6
Have you tried reinstalling the 'sqlite3-ruby' gem?
There might be some sqlite-ruby interface issue in your system as this SO answer, Sqlite3 error after Rails 3 (beta 4) install, points out.
And also, you should use rvm/rbevn and ruby 1.9 if there isn't any specific requirement for ruby 1.8.

Problem to run rspec test on my model

when I use command spec path/to/spec_file.rb then it come with the message below. I am not sure what wrong with my RSpec or with my ROR since I use RVM(Rail 3 and Ruby 1.9.2)
/var/www/resource_mapper_spike/config/boot.rb:3: uninitialized constant YAML::ENGINE (NameError)
from /var/www/resource_mapper_spike/config/application.rb:1:in `require'
from /var/www/resource_mapper_spike/config/application.rb:1
from /var/www/resource_mapper_spike/config/environment.rb:2:in `require'
from /var/www/resource_mapper_spike/config/environment.rb:2
from /var/www/resource_mapper_spike/spec/spec_helper.rb:3:in `require'
from /var/www/resource_mapper_spike/spec/spec_helper.rb:3
from ./spec/models/layer_spec.rb:1:in `require'
from ./spec/models/layer_spec.rb:1
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:15:in `load'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:15:in `load_files'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:14:in `each'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:14:in `load_files'
from /usr/lib/ruby/1.8/spec/runner/options.rb:134:in `run_examples'
from /usr/lib/ruby/1.8/spec/runner/command_line.rb:9:in `run'
from /usr/bin/spec:3
I just found problem with my command. spec command could run only on rails 2 but in rails 3 I have to use command rspec

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

Resources