Ruby on Rails Error on Windows 10 - ruby-on-rails

How can I solve this problem? please, help.
I am using windows 10 and I am trying to run this already existing RoR project.I am very newbie to these projects. Here an error with stack:
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-3.2.6/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.rb:17:in require': cannot load such file -- 2.2/http11 (LoadError)
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.rb:17:inrescue in '
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.rb:13:in <top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:inrequire'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in block (2 levels) in require'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:ineach'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in block in require'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:ineach'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in require'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler.rb:106:inrequire'
from C:/bottomup_source/bottomup_source/config/application.rb:7:in <top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-3.2.6/lib/rails/commands.rb:53:inrequire'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-3.2.6/lib/rails/commands.rb:53:in block in <top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-3.2.6/lib/rails/commands.rb:50:intap'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-3.2.6/lib/rails/commands.rb:50:in <top (required)>'
from script/rails:6:inrequire'
from script/rails:6:in `'

i m using ruby on rails from last one year , i would recommend you to use linux or ubuntu for ruby on rails as most of the tools are not compatible with windows for development, but still if you want to use on windows os the follow this ruby on rails on window hopefully this will help you.

Related

Ruby on Rails - after rails_s is entered

I am learning Ruby on Rails and still unfamilar with some of parts of the language.
I am trying to get a rails project to display on Firefox however as soon as I enter the command "rails s" I am presented with the following error:
Rails S Error
The source code is :
C:\Sites\weeks_1_-_15\week_1\bookshop1a>rails s
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.0.2/lib/act
ive_support/values/time_zone.rb:282: warning: circular argument reference - now
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x86-mingw32/
lib/sqlite3.rb:6:in require': cannot load such file -- sqlite3/sqlite3_native (
LoadError)
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10
-x86-mingw32/lib/sqlite3.rb:6:inrescue in '
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10
-x86-mingw32/lib/sqlite3.rb:2:in <top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6
/lib/bundler/runtime.rb:91:inrequire'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6
/lib/bundler/runtime.rb:91:in block (2 levels) in require'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6
/lib/bundler/runtime.rb:86:ineach'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6
/lib/bundler/runtime.rb:86:in block in require'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6
/lib/bundler/runtime.rb:75:ineach'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6
/lib/bundler/runtime.rb:75:in require'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.13.6
/lib/bundler.rb:106:inrequire'
from C:/Sites/weeks_1_-_15/week_1/bookshop1a/config/application.rb:7:in
<top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.0.2
/lib/rails/commands.rb:74:inrequire'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.0.2
/lib/rails/commands.rb:74:in block in <top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.0.2
/lib/rails/commands.rb:71:intap'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.0.2
/lib/rails/commands.rb:71:in <top (required)>'
from script/rails:6:inrequire'
from script/rails:6:in `'
Any help would be much appreciated!
Thank you!
The error message indicates that SQLite is not installed or properly configured.
Try starting rails server after installing SQLite first.
Maybe this tutorial is helpful to get SQLite up and running:
http://www.sqlitetutorial.net/download-install-sqlite/

Can't load sqlite3 for Ruby on Rails 5 for Windows 10

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.

rails 4.2.0 console broken with 'file is already defined'

Currently using rails 4.2.0 & ruby 2.2.0p0
re-bundled to pick up some gem updates
RAILS_ENV=production rails c fails with the following stack trace
/home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:76:in require': File is already defined (NameError)
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:76:inblock (2 levels) in require'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:72:in each'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:72:inblock in require'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:61:in each'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:61:inrequire'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler.rb:134:in require'
from /home/linkee/linker/config/application.rb:14:in'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:in require'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:inrequire_application_and_environment!'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:67:in console'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:inrun_command!'
from /home/linkee/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in <top (required)>'
from /home/linkee/linker/bin/rails:4:inrequire'
from /home/linkee/linker/bin/rails:4:in `'
I note that the runtime.rb fails when trying to require 'zipruby' so I excluded that gem from being required by changing line 76 in require.rb to
pp required_file = file
Kernel.require(file) unless file == 'zipruby'
and that at least bypassed whatever the problem was.
Please let me know if you require further information to help in sorting out this problem.

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

Ruby on Rails sqlite3 entry point not found

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

Resources