I'm unable to get Ruby on Rails working anymore (fiddled with Ruby [not Rails] a while ago, bla bla), and I'm stuck for a reason/fix for my problem.
I'm running XP, Ruby 1.9.2 (p180), sqlite3 (1.3.3 x86-mingw32), rails (3.0.7), and here is basically what I did earlier tonight:
DL/Install Ruby (rubyinstaller-1.9.2-p180)
DL sqlite3.exe, .dll, and .def, placed them in the \ruby192\bin\ directory (also note after the problem, I placed the .exe, .dll, and .def in the lib directory for the sqlite3 gem)
gem install sqlite3, activesupport, and rails (in that order)
rails new demo
(in the newly created folder) rails s
and what I get out of all this...
The procedure entry point sqlite3_column_database_name could not be located in the dynamic link library sqlite3.dll
C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:i
n `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/s
qlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/s
qlite3.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runt
ime.rb:68:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runt
ime.rb:68:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runt
ime.rb:66:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runt
ime.rb:66:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runt
ime.rb:55:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runt
ime.rb:55:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler.rb:1
20:in `require'
from C:/ruby/demo/config/application.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/comman
ds.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/comman
ds.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/comman
ds.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/comman
ds.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
yeah, had similar problem on my windows laptop recently.
the problem is that you're using the most recent sqlite3 binaries, but the gem doesn't seem to be able to work with these. Unfortunately, I don't remember what exact version of sqlite3 binaries solved. Just try few previous versions
I had the exact same problem on my windows 7 x64 box with the exact same rails and ruby version as you. I found out the latest version of sqlite3, version 3.7.6.2, that I had seems to be incompatible. I was able to download 3.7.4 via this link: sqlite3 version 3.7.4.
Using version 3.7.4 by just replacing the sqlite3 dll file in my ruby\bin directory worked like a charm for me
Related
Just installed Ruby on Rails 5 on Windows 10. I tried to run the rails server but it gave me the error below. I've tried a bunch of different solutions but nothing seems to work, probably because most of the suggestions were before RoR4. I've updated my PATH/environment variable and extracted the DLL and executable from the sqlite website and put that into my directory, ran bundle install...
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from C:/Users/Tim/Documents/GitHub/event-registration-system/config/application.rb:7:in `<top (required)>'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I ended up just uninstalling everything and then using RailsInstaller to set up my Rails environment for Windows and this problem was resolved. Rails 5 does work with sqlite now.
I'm not sure what the problem was, but this was the solution that worked for me. Wanted to post it here in case anyone else was experiencing this on the newer versions of the language or framework.
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 am running Debian 7. I am using RVM. I am also running mySQL. I am new to ruby in general as well as rails. Please excuse any of me if I seem naive at all.
I setup a project with:
rails new projectname -d mysql
Then I went into that directory and ran:
rails server
I then get this error:
/home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/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/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs.rb:5:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs.rb:4:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/user/htdocs/simple_cms/config/application.rb:7:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in '
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:50:in `'
from script/rails:6:in `require'
from script/rails:6:in `'
I went to the link that was provided: https://github.com/sstephenson/execjs
The Read Me under Install says:
gem install execjs
I do this and still get the same error. I am lost.
You have to first install a Javascript runtime, such as Node.js.
For Debian, there's installation instructions on Node.js Github
Edit: The ExecJS README lists the supported Javascript runtimes.
I did install therubyracer. I put the necessary gems insides the projects gem file. This seems to have solved this issue.
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
I just started learning ruby on rails with "Lynda Ruby on Rails 3 Essential Training".
I finished the installation, and created rails application by writing- "rails new app".
After that when I wrote - "rails server", that's what I saw:
C:\Users\Oded\sites\simple_cms>rails server
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.r
b:2:in `require': 193: %1 is not a valid Win32 application. - C:/Ruby192/lib/r
uby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError
)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2.rb:7:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:64:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:64:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:62:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:62:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:51:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:51:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:11
2:in `require'
from C:/Users/Oded/sites/simple_cms/config/application.rb:7:in `<top (re
quired)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can you please help me find the solution?
Happy holidays,
Oded
Looks like you're missing some gems! try running bundle install... then all should work.
EDIT: make sure that your Gemfile contains the line
gem 'mysql'
before running bundle install. Bundler will get you set up for mysql, dependencies and all.
You have to go to this website and follow the directions ...
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
or in short download the connector mentioned in the article from mysql or a mirror site
Run this command:
gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32
Make sure you have the correct path to the mysql connector folder that has no spaces!!
After that is complete make sure you copy the libmysql.dll file from the connector library you unzipped and downloaded and placed that in the Ruby\bin file.
After that delete the connector libary and start it up by typing 'rails server' making sure your gem file has the line gem 'mysql' or gem 'mysql2' I'm not sure which one so try both. It sucks and they really need to fix this for windows.