In an effort to broaden my development reach, and potentially work on a RoR project, I decided to test the development environment of RoR, and see how confusing and frustrating it can be, by setting up the environment by myself, and just using some basic online tutorials to get me started.
Ill document the useful resources that I find in this post, and hope that it will serve as a quick startup guide for true RoR noobs, like myself.
Dev Environment Setup
In my environment, I already have WAMP stack installed … via EasyPHP-3.0, so for this, I did not have to reinstall mysql (though I did have to hook the two together … ill show you).
First, download Ruby and run the installer.
Ruby Download
After reading a bit about the various IDEs (coming from a Dreamweaver PHP/mySQL environment), I chose to install a trial version of RubyMine 3.x, as many users on stackoverflow preferred it as a more complete package.
RubyMine Download
- Run the RubyMine installer, and then start a new project (Rails). Once you have done this, and named it, you can select the SDK location of Ruby (pathTORuby/bin/ruby.exe), and then the Gems/Rails will get downloaded/installed by itself.
- Select mySQL as the DB type to setup. It will then load the mySQL plugins needed when you select the instructed installer bar in the interface (you’ll see it).
- In this current context, you will probably get errors on run, since you have not hooked mysql up to the Ruby environment. Close out RubyMine.
Go to the EasyPHP folder, and search for libmysql.dll – Find that file, copy it, and paste it to the [RUBY]/bin/ directory of your ruby install.
Now, open RubyMine again, and hit run… if your mysql2 gem is installed, then this should all start correctly, and you should be directed to a browser (localhost) address that you can stick in any browser, and you will see your default Ruby Install homepage is up and running – SUCCESS!!
Here is the error message I was getting earlier, before fixing the mysql issues, for your reference:
D:\ProgramFiles\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/Rob/RubymineProjects/test1/script/rails server -p 3000 -b 127.0.0.1 -e development D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not be found. - D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError) from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in `require' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in `<top (required)>' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `block (2 levels) in require' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `block in require' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:112:in `require' from C:/Users/Rob/RubymineProjects/test1/config/application.rb:7:in `<top (required)>' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:28:in `require' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:28:in `block in <top (required)>' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap' from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>' from C:/Users/Rob/RubymineProjects/test1/script/rails:6:in `require' from C:/Users/Rob/RubymineProjects/test1/script/rails:6:in `<top (required)>' from -e:1:in `load' from -e:1:in `<main>' Process finished with exit code 1



