undefined method eager_autoload when trying to start rails server [closed] - ruby-on-rails

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
UPDATE: I fixed the error by installing rack-cache gem
I was trying to start a rails server on one of my project and got this error
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.0/lib/action_controller/metal/strong_parameters.rb:105: warning: already initialized constant NEVER_UNPERMITTED_PARAMS
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.0/lib/action_controller/metal/strong_parameters.rb:105: warning: already initialized constant NEVER_UNPERMITTED_PARAMS
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-action_caching-1.1.0/lib/action_controller/action_caching.rb:3:in `<module:Caching>': undefined method `eager_autoload' for ActionController::Caching:Module (NoMethodError)
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-action_caching-1.1.0/lib/action_controller/action_caching.rb:2:in `<module:ActionController>'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-action_caching-1.1.0/lib/action_controller/action_caching.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-action_caching-1.1.0/lib/actionpack/action_caching.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `rescue in block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /vagrant/captiv8/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I tried to reinstall the actionpack gem but the problem still persist.

try command "bundle exec rails server"

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.

error when running ruby server [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I'm fairly new to ruby on rails. Project was working fine I saved and closed the box. when I reopened it and tried running the server I got this:
/home/action/croquet/config/routes.rb:1:in `<top (required)>': undefined local variable or method `rRails' for main:Object (NameError)
from /home/action/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `load'
from /home/action/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `block in load'
from /home/action/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /home/action/.rvm/gems/ruby-2.1.3/gems/spring-1.2.0/lib/spring/client.rb:26:in `run'
from /home/action/.rvm/gems/ruby-2.1.3/gems/spring-1.2.0/bin/spring:48:in `<top (required)>'
from /home/action/.rvm/gems/ruby-2.1.3/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `load'
from /home/action/.rvm/gems/ruby-2.1.3/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/action/croquet/bin/spring:16:in `require'
from /home/action/croquet/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
typing mistake. It should be Rails not rRails.
You have a typo on rRails. It should be Rails.applications.routes.draw

Rails server couldn't start in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I installed ruby 2.1.0 and rails 4.0.4. I created an application. When I started 'rails server', I got following errors:
/home/chandra/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/uglifier-2.5.0/lib/uglifier.rb:3:in `require'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/uglifier-2.5.0/lib/uglifier.rb:3:in `<top (required)>'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `require'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `each'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `block in require'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `each'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `require'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler.rb:132:in `require'
from /home/chandra/Desktop/webApplication/assignment1/blog/config/application.rb:7:in `<top (required)>'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/railties-4.0.4/lib/rails/commands.rb:74:in `require'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/railties-4.0.4/lib/rails/commands.rb:74:in `block in <top (required)>'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/railties-4.0.4/lib/rails/commands.rb:71:in `tap'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/railties-4.0.4/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Any suggestion? Thanks.
As the first line says: You need to install a JavaScript runtime library. And you will find further information at the given url: https://github.com/sstephenson/execjs
Install a javascript runtime like node js
if you are using ubuntu then follow the steps to get it install
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
Have you tried to put gem 'therubyracer' in your gemfile?

Does TinyTDS support Ruby 2.0.0?

I am having real trouble trying to get TinyTDS working with Ruby 2.0.0 on Windows 7.
When i run a rails c (or require tiny_tds from an irb), i get the following:
D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- tiny_tds/tiny_tds (LoadError)
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds.rb:16:in `rescue in <top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds.rb:12:in `<top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from S:/code/user/app/ruby2_test/config/application.rb:7:in `<top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:39:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have tried installing the latest version of the gem:
gem install tiny_tds --pre
And looking inside:
D:\Ruby\Ruby200\lib\ruby\gems\2.0.0\gems\tiny_tds-0.6.0.rc1-x86-mingw32\lib\tiny_tds
I can see there is no 2.0 directory, which leads me to believe version 2.0 isn't supported. However i can see no mention on the TinyTDS github or any other sites about this issue.
So, am i missing something or does TinyTDS currently just not work with Ruby 2.0?
Copying the answer from the comments in order to remove this question from the "Unanswered" filter:
I believe this is an issue with OS that you are using as another
individual had the same issue. As stated I believe this is a
dependency issue with Windows. Please see the comment from MetaSkills
- https://github.com/rails-sqlserver/tiny_tds/issues/110#issuecomment-15503928
~ answer per David

Can't get MYSQL to run with Ruby on Rails on Windows [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
mysql2 gem compiled for wrong mysql client library
Here's the error I keep getting:
C:\Sites\ProjectName>rails s
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.
rb:2:in `require': Incorrect MySQL client library version! This gem was compiled
for 6.0.0 but the client library is 5.5.28. (RuntimeError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runti
me.rb:68:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runti
me.rb:68:in `block (2 levels) in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runti
me.rb:66:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runti
me.rb:66:in `block in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runti
me.rb:55:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runti
me.rb:55:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler.rb:12
8:in `require'
from C:/Sites/ProjectName/config/application.rb:7:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/comman
ds.rb:53:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/comman
ds.rb:53:in `block in <top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/comman
ds.rb:50:in `tap'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/comman
ds.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I know it says the error in my face unfortunately I have no idea how to fix it, any help would be appreciated.
Take a look at mysql2 gem compiled for wrong mysql client library
There's a full explanation of what's happening, and suggestions for how to fix the problem.

Resources