Install #RubyOnRails 2.3.3 with Windows 10 and XAMPP

 

Use RailsInstaller.exe Version 2.3.3 from RailsInstaller.org

The installation itself works fine, but alas this is not the end of the story; the proverbial rabbit-hole.

They have an error in their .bat files \…Install\Ruby2.3.0\bin. Change the path of …\ruby.exe in the .bat to your local PATH, e.g. C:\RailsInstaller\Rub2.3.0\bin\…

rails.bat
bundle.bat
rake.bat
sprockets.bat
sqlite3_ruby.bat
thor.bat
tsql.bat

and far more seriously: after you have created your new project [rails new <project-name>] and made any required tweaks to the gemfile and the database.yml, you need to naturally start the server, but this install version which uses puma [http server] doesn’t seem to invoke it? Fix with:

bundle exec rails s puma

as a server start.  rails s  will complain on its own !

Another solution is to downgrade your version of rails to a more stable version .e.g. 4.2.6 and this is what I did:

gem uninstall rails

gem uninstall railties

gem install rails -v 4.2.6

THEN everything works fine using rails s as a server start ! As a side note: if you are planning on installing third party Gems such as Spree [eCommerce Shop] then you’ll want to do this downgrade.

Final point when it comes to creating new sites:

Better to use rails new <project-name> -d mysql so your system is set up with MySQL by default, e.g. your database.yml file should look something like this:

default: &default
 adapter: mysql2
 encoding: utf8
 username: <user>
 password: <password>
 # pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
 # timeout: 5000
 host: 127.0.0.1
 port: 3306

development:
 <<: *default
 database: <mySQL database> e.g. bookshop
 #database: db/development.sqlite3

test:
 <<: *default
 database: <mySQL database> e.g. bookshop_test
 #database: db/test.sqlite3

production:
 <<: *default
 database: <mySQL database> e.g. bookshop_live 
 #database: db/production.sqlite3

Just to make development a little easier

Let’s say your server is local at 192.168.1.200. It’s much better to start the server with this IP address so that any workstation can see the new Ruby Site with 192.168.1.200:3000, otherwise you’re restricted to working as localhost:3000

rails s -b 192.168.1.200

Leave a reply:

Your email address will not be published.

Site Footer