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.
Related
while generating controllers, I am getting this error message:
Leticias-MacBook-Pro:portfolio Tish$ rails g controller welcome index about music loops projects
/Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `require': incompatible library version - /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3/sqlite3_native.bundle (fatal)
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:2:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /Users/Tish/Projects/portfolio/config/application.rb:7:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `preload'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:143:in `serve'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:131:in `block in run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `loop'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Nothing I have tried makes it stop. I have reinstalled every gem it complains about, but the changes do not persist. I've followed every fix I can find/understand but I am chasing my tail on this one.
Working on OSX...
Your rails is not linked with the right ruby version. Use the following code:
rvm use ruby-<version number> like: (rvm use ruby-2.1.4)
then reinstall the bundler:
gem uninstall bundler
gem install bundler
bundle install once again with the new version.
bundle install
Then proceed with your rails g command.
I have just started learning Ruby on Rails. I installed all the related softwares and started exploring the same. When I try to start the default server in Rails (WEBrick), I am getting the following error.
C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:40:in `<module:Helpers>': uninitialized constant ActionView::Helpers::ActiveModelHelper (NameError)
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:4:in `<module:ActionView>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:3:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/base.rb:5:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/base.rb:5:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:7:in `<class:Template>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:6:in `<module:WebConsole>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:1:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console.rb:12:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console.rb:12:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web-console.rb:1:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web-console.rb:1:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from C:/Temp/Rails-Project/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in`require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in`block in server'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in`tap'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in`server'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in`run_command!'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Upon research in SOF, found from the link and other link that the nokogiri needs to be updated in the Gemfile. I updated and executed the Bundle Install command. Even after that, its not working. Please suggest me the ways to fix it. FYI, I am using the latest versions of gems.
I also updated my Gemfile with
gem 'rack', '~> 1.6.0'
It did not work.
Install an older version of rails (4.0.0) because I think windows doesn't have stable version of rails > 4.0.
Change the version in gemfile.
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
in my application, in the last few days, i'm unable to run the rails server/rails s or even bundle exec rails server command any more.
it was running like a charm before.
i tried to revert the changes using git, but no luck, i tried all the possible proprieties i could think of.
i use rubymine, but same problem when using the Terminal .
when i run:
ma#SL510:~/ts$ rails server
i get the following error stack trace :
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392#global/gems/unicorn-4.6.2/lib/unicorn/http_request.rb:4:in `<top (required)>'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392#global/gems/unicorn-4.6.2/lib/unicorn.rb:103:in `<top (required)>'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
from /home/ma/ts/config/application.rb:16:in `<top (required)>'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
i don't know how could i fix this, to get the rails server command to run again !
any help would be appreciate it !
ps: please tell me if i need to provide more info. Thanks.
Thanks to Jef
creating a new gemset and using it
and after this:
gem install unicorn
fixed the problem with that command :)
You may try to create a brand new gemset (and use it), then bundle install so that Bundler install gems listed in your Gemfile. The stacktrace seems to indicate you're using the global gemset, which is a really bad idea.
Ruby and rails noob, made a project and got this far. But now I'm getting these errors when trying to run rails server. I'm using Windows vista and ruby 2.0.0.
D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.
rb:2:in `require': cannot load such file -- mysql2/2.0/mysql2 (LoadError)
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2/mysql2.rb:2:in `<top (required)>'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `<top (required)>'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:72:in `require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:72:in `block (2 levels) in require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:70:in `each'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:70:in `block in require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:59:in `each'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:59:in `require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler.rb:13
2:in `require'
from D:/wamp/www/simple_cms/config/application.rb:7:in `<top (required)>
'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:53:in `require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:53:in `block in <top (required)>'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:50:in `tap'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I know very little about ruby and gems so far but the mysql2 gem seems to be a problem wich I have installed and installed to no help. I do constantly get a message that I have installed the binary version with orders that I've followed. Is this a good or bad thing?
Anyone please help me out, if you need more info just let me know.
I think the answer here is what you are looking for:
stackoverflow.com/a/5368767/1622843
Basically, you need to point the gem to use your mysql instance installed on your machine.