Hi guys,
i am having a little problem. I have installed ruby 1.9.1 and rails
2.3.5. Ruby is working just fine. The rails applications is being
created fine. But when i run the command ruby script/server i get an
error that says “The program can’t start because msvcrt-ruby18.dll is
missing”.
I googled this message and is pointed to this page:
I installed all there binaries but the error exists!
The strange is that i get the error, it says that the server starts
normally but when i go to the browser i can see nothing. Here’s what i
get:
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-01-24 13:12:51] INFO WEBrick 1.3.1
[2010-01-24 13:12:51] INFO ruby 1.9.1 (2009-07-16) [i386-mingw32]
[2010-01-24 13:12:51] INFO WEBrick::HTTPServer#start: pid=644
port=3000
Unzip the devkit and after your ruby installation is installed, copy and
paste the devkit per the installation notes inside of it within the same
base installation directory of your ruby installation.
Example:
C:\ruby19
Take what’s inside the zip of the devkit copy and paste within C:\ruby19
which will add some extra things to C:\ruby19\bin and also create a
devkit directory for C:\ruby19\devkit.…
Then you need to install your gems using the correct platform which will
be:
gem install “gemname” --platform x86-mingw32
… which will make sure that you are using the correct gems for your
platform type. The 1.9.1 package was compiled with mingw so you need to
force platform compiling to mingw.
If you have issues, consult the Ruby forum and not the Ruby on Rails
forum.
Secondly, if you are using an IDE environment to program and develop
within, say for example Netbeans, then the issue could extend to the IDE
and not to your environment. So, you want to make sure that you always
use a dos command prompt and run your server commands there first to
make sure it works properly.
ruby script/server → as an example
Thirdly, you should get rid of webrick as soon as possible on windows
and go with mongrel. However, you’ll need to make sure that you have
the devkit installed in Ruby 1.9.1 in order to compile some of the
platform gems for mingw32.
You’ll also find that there are times that your gems won’t work, which
is why you always need to test them to see if they work. With ruby
1.9.1 you don’t need to require rubygems but you do this by going doing
the following:
Go to a command prompt.
Type irb and hit enter.
Type require ‘gemname’
The output should show => ‘true’
If you get a big long error list, then the gem is not compiled properly
for your system so you need to make sure you added your platform
arguments and if this still fails, you need to visit the following site:
… search for the gem and read the comments and find a better source for
your gem.
Once all of your gems are tested in irb with require and they all show
true, then you know that you have zero issues with your gems, which
makes troubleshooting your environment easier.
Then boot your server using a dos window and not an ide window and make
sure it all works.