Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Installing a Ruby Development Environment Installing a Ruby Development Environment Installing Ruby on Windows

Trouble installing Ruby Development Environment on Windows

I tried following Treehouse instructions for installing the Ruby Development Environment on Windows. I installed Ruby 2.1.3 p242. I get as far as creating a Rails new test app, but when I run bundle exec rails server, it does not indicate that the Rails app has started. I don't see any local host information. When run the bundle exec rails server command, a message or perhaps "error" says "“DL is deprecated, please use Fiddle.”

I think I'm close to setting up the Ruby dev environment, but don't know how to resolve the issue. I've watched the Treehouse video a couple of times, but I don't find it helpful in troubleshooting the problem. Can someone give me detailed advice about how to solve this issue. Thank you!

Problem solved for now. I uninstalled Ruby version 2.1.3 and installed version 2.0.0. Now the server now runs and operates on my Windows machine.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Good to hear it works :). Remember to one day switch to Linux or Mac - it will work faster, will be more consistent with commands seen in the videos, will give you much more support online in case of trouble (Windows is rarely used by Rails developers) and will give you less issues.

Will do ... I have a couple of Linux machines. I'll install Ruby/Rails on one of them too. Thanks for the advice!

2 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Ignore the whole bundle exec thing in the console. Try just rails server and then (ignore the warnings, if any) open http://localhost:3000/ in your browser to see if it's in fact successful.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

In the long run, Windows is not the best or the most friendly environment for Rails development. Consider installing Linux (dual boot or using free VMWare Player) in the future.

Thanks for replying. I tried your suggestion, but still can't connect at localhost:3000. I want to install the Ruby dev environment on Windows, because my Windows box is a laptop.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK, did you make sure you installed the 32-bit version of Ruby? The 64-bit version has issues. And then you successfully completed gem install rails?

Using information from the stackoverflow article, I added "sqlite3_naticve" to the s.require_paths=["lib"] in my /sqlite3-1.3.7.gemspec. It appears the change gets my rails server running; but the I get the following error message:

Could not load 'active_record/connection_adapters/sqlite3_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile.

Rails.root: C:/Users/tmbrid/Documents/testapp

How do I resolve this error? I appreciate all your help!

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Can you paste your database.yml file and Gemfile here using Markdown?

Contents of my database.yml file from the testapp directory:

``

SQLite version 3.x

gem install sqlite3

Ensure the SQLite 3 gem is defined in your Gemfile

gem 'sqlite3'

default: &default adapter: sqlite3 pool: 5 timeout: 5000

development: <<: *default database: db/development.sqlite3

Warning: The database defined as "test" will be erased and

re-generated from your development database when you run "rake".

Do not set this db to the same as development or production.

test: <<: *default database: db/test.sqlite3

production: <<: *default database: db/production.sqlite3 ``

Contents of my Gemfile from ruby21/bin directory:

``

!/usr/bin/env ruby

--

Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.

All rights reserved.

See LICENSE.txt for permissions.

++

require 'rubygems' require 'rubygems/gem_runner' require 'rubygems/exceptions'

required_version = Gem::Requirement.new ">= 1.8.7"

unless required_version.satisfied_by? Gem.ruby_version then abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}" end

args = ARGV.clone

begin Gem::GemRunner.new.run args rescue Gem::SystemExitException => e exit e.exit_code end

``

I'm not sure which "gemfile" you're requesting ... this is the contents of the gem file I found in my testapp directory:

`` source 'https://rubygems.org'

Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '4.1.6'

Use sqlite3 as the database for Active Record

gem 'sqlite3'

Use SCSS for stylesheets

gem 'sass-rails', '~> 4.0.3'

Use Uglifier as compressor for JavaScript assets

gem 'uglifier', '>= 1.3.0'

Use CoffeeScript for .js.coffee assets and views

gem 'coffee-rails', '~> 4.0.0'

See https://github.com/sstephenson/execjs#readme for more supported runtimes

gem 'therubyracer', platforms: :ruby

Use jquery as the JavaScript library

gem 'jquery-rails'

Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks

gem 'turbolinks'

Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

gem 'jbuilder', '~> 2.0'

bundle exec rake doc:rails generates the API under doc/api.

gem 'sdoc', '~> 0.4.0', group: :doc

Use ActiveModel has_secure_password

gem 'bcrypt', '~> 3.1.7'

Use unicorn as the app server

gem 'unicorn'

Use Capistrano for deployment

gem 'capistrano-rails', group: :development

Use debugger

gem 'debugger', group: [:development, :test]

Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem 'tzinfo-data', platforms: [:mingw, :mswin]

``

Hi Maciej --

I just want to let you know ... I uninstalled Ruby v. 2.1.3 and installed version 2.0.0. That solved the problem. The Ruby development environment appears to be up and running now on my Windows machine. I apprecite all your help in troubleshooting the problem! Thank you.

Best regards.

Hi Maciej -

Yes, made sure I installed the 32-bit version of Ruby, and I successfully installed rails. When I run Ruby -v command, I get Ruby 2.1.3 and with Rails -v I get Rails 4.1.6.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

So when you do rails new app_name, go to the app_name folder and do rails server, what do you get in the console exactly? Can you copy and paste the whole output here?

When I execute the above commands, this is what I get in the console:

C:\Users\tmbrid\Documents\testapp>rails server C:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x86-mingw32/lib/sqlite3.rb:6:in require': cannot load such file -- sqlite3/sqlite3_native (LoadError) from C:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x86-mingw32/lib/sq lite3.rb:6:inrescue in <top (required)>' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x86-mingw32/lib/sq lite3.rb:2:in <top (required)>' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtim e.rb:76:inrequire' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtim e.rb:76:in block (2 levels) in require' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtim e.rb:72:ineach' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtim e.rb:72:in block in require' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtim e.rb:61:ineach' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtim e.rb:61:in require' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler.rb:133 :inrequire' from C:/Users/tmbrid/Documents/testapp/config/application.rb:7:in <top (required)>' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/command s/commands_tasks.rb:79:inrequire' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/command s/commands_tasks.rb:79:in block in server' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/command s/commands_tasks.rb:76:intap' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/command s/commands_tasks.rb:76:in server' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/command s/commands_tasks.rb:40:inrun_command!' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/command s.rb:17:in <top (required)>' from bin/rails:4:inrequire' from bin/rails:4:in `<main>'

C:\Users\tmbrid\Documents\testapp>

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

ok, try running bundle install when in the app directory and then run the server again.