when i give the command "rails s" following error comes please help me! still i'm in rails project and then give this command
root#ubuntu:~# cd mon
root#ubuntu:~/mon# rails s
/usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs.rb:5
from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1
from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1
from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
from /root/mon/config/application.rb:7
from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53:in `require'
from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53
from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50
from script/rails:6:in `require'
from script/rails:6
add
gem 'therubyracer'
to your Gemfile and run
bundle
command The 'rails new' command creates a new Rails application with a default
directory structure and configuration at the path you specify.
You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory,
or in $XDG_CONFIG_HOME/rails/railsrc if XDG_CONFIG_HOME is set.
Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.
You need to install a javascript runtime such as:
gem install therubyracer
or
http://nodejs.org/
This is used by the asset pipeline in rails 3 for compiling the coffeescript.
Related
I pushed a (very simple) Rails app up to Heroku, the build was successful and it works online (minus some route issues), but now I can't get it to run locally. It's actually a clone of the "getting started" app I thought I'd modify to avoid deployment issues. When I try to start a Rails server I get the following message:
$ rails s
Looks like your app's ./bin/rails is a stub that was generated by Bundler.
In Rails 4, your app's bin/ directory contains executables that are versioned
like any other source code, rather than stubs that are generated on demand.
Here's how to upgrade:
bundle config --delete bin # Turn off Bundler's stub generator
rake rails:update:bin # Use the new Rails 4 executables
git add bin # Add bin/ to source control
You may need to remove bin/ from your .gitignore as well.
When you install a gem whose executable you want to use in your app,
generate it and add it to source control:
bundle binstubs some-gem-name
git add bin/new-executable
Bundler::GemRequireError: There was an error while trying to load the gem 'uglifier'.
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/execjs-2.7.0/lib/execjs.rb:4:in `<main>'
org/jruby/RubyKernel.java:961:in `require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/uglifier-3.2.0/lib/uglifier.rb:1:in `<main>'
org/jruby/RubyKernel.java:961:in `require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/uglifier-3.2.0/lib/uglifier.rb:5:in `block in (root)'
org/jruby/RubyArray.java:1734:in `each'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler/runtime.rb:1:in `block in (root)'
org/jruby/RubyArray.java:1734:in `each'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler/runtime.rb:82:in `require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler/runtime.rb:77:in `require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler/runtime.rb:66:in `<main>'
org/jruby/RubyKernel.java:961:in `require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler.rb:108:in `block in require'
org/jruby/RubyKernel.java:1747:in `tap'
C:/blog/config/application.rb:7:in `(root)'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:1:in `(root)'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `<main>'
org/jruby/RubyKernel.java:961:in `require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `block in server'
org/jruby/RubyKernel.java:1298:in `loop'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<main>'
org/jruby/RubyKernel.java:961:in `require'
C:/jruby-9.1.12.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54:in `require'
C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/app_rails_loader.rb:1:in `<main>'
org/jruby/RubyKernel.java:979:in `load'
C:/jruby-9.1.12.0/bin/rails:22:in `<main>'
Bundler Error Backtrace:
block in require at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler/runtime.rb:85
each at org/jruby/RubyArray.java:1734
block in require at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler/runtime.rb:77
each at org/jruby/RubyArray.java:1734
require at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler/runtime.rb:66
require at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bundler-1.15.3/lib/bundler.rb:108
<main> at C:/blog/config/application.rb:7
require at org/jruby/RubyKernel.java:961
block in (root) at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:1
tap at org/jruby/RubyKernel.java:1747
server at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78
server at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75
<main> at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39
require at org/jruby/RubyKernel.java:961
block in (root) at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/commands.rb:17
loop at org/jruby/RubyKernel.java:1298
(root) at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/app_rails_loader.rb:1
<main> at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/app_rails_loader.rb:45
require at org/jruby/RubyKernel.java:961
require at C:/jruby-9.1.12.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54
<main> at C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/railties-4.2.4/lib/rails/app_rails_loader.rb:34
load at org/jruby/RubyKernel.java:979
<main> at C:/jruby-9.1.12.0/bin/rails:22
Removing uglifier and coffee-rails gets the app up and running locally so, I tried that and followed the upgrade instructions, then used bundle install to add them again, with the same result. I also can't push a version of this app up to Heroku without those gems so I'm left scratching my head where to go from here.
Here is a copy of the app I pushed to Git (excuse the language on one of the commits I was quite frustrated) to help with trouble shooting
https://github.com/taswelldavis/blog
Thanks for the help,
Anna
I'm trying to start a server on rails but it isn't working, any ideas on why that might be? I haven't edited the proyect, this is my first try at starting it. I've reinstalled gems and used bundle install with some different options, but all to no avail. I'm working on Windows.
C:\Users\Julián\Documents\Sites\simple_cms>rails server
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/comman
ds_tasks.rb:79:in `require': cannot load such file -- C:/Users/Julián/Documents/Sites/simple_cms/config/application (LoadError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
UPDATE:
I ran the same command on a new proyect located on another folder without any strange characters (Such as "á"), also unsuccessfully. Here's the new error.
C:\Users\Public\Sites\simple_cms>rails server
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `require': 126: The specified module could not be found. - C:/Ruby200-x64/lib/ruby/gems/2.0.0/extensions/x64-mingw32/2.0.0/mysql2-0.3.16/mysql2/mysql2.so (LoadError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler.rb:132:in `require' from C:/Users/Public/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
It looks like command_tasks.rb cannot find your application file. It's probably because of the path name. C:/Users/Julián/Documents/Sites/simple_cms/config/application It looks like it mistook your name Julián for Julián
Bundle Install
Could be wrong, but certainly seems you have a lack of the mysql2 gem, or the mysql files Rails needs to load your app.
Confirmation of this would come if you performed bundle install on your system - I surmise the mysql gem would fail
MYSQL Gem
Considering you're on Windows, you've probably not got the MYSQL2 gem installed - standard issue which we wrote a tutorial about here:
Install any MYSQL C-Connector Header files on your system
Install the mysql2 gem with the relevant arguments
Copy the libmysql.dll file to your ruby/bin directory
The C-Connector header files are vital for Windows, as they allow your system to "read" the MYSQL commands / requests. These are not installed by default, so you have to install them yourself (it's only to install the gem, then you can get rid of them if you want):
Install this file, then you can use the following install command:
gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector-path"'
This should install the gem on your system, which you'll then be able to finish by transferring libmysql.dll from your mysql files' bin directory to your ruby/bin directory:
May be, in other way you should try virtual machine with Linux (Ubuntu).
I started first time rails with Windows but it was so hard to operate gems and environment.
I setup a new rail application in Netbeans 7.1. Without writing any code, I wanted to see if it just runs but
When clicking run I get errors:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not be found. - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:119:in `require'
from C:/_PROJECTS/active/Callisto2.0/config/application.rb:7:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've installed a few gems it was complaining about through netbeans gem manager but I got stuck at mysql2. Even though I installed mysql and mysql2 gems, it still won't find it.
With little research, it seems i have to do a bundle install, for WEBrick to run/ check dependencies or whatever. Netbeans project has a Bundler context menu with options for check, init, install, show etc.
None of those produce any output in the Output: Bundler window. The Bundler process starts in netbeans processes but then quits after a second. No errors, info or anything.
What do I need to do to get this working. This is a blank Ruby/Rails Application through Netbeans 7.1.
EDIT 1:
The error in file: C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2 contains the following lines:
RUBY_VERSION =~ /(\d+.\d+)/
require "mysql2/#{$1}/mysql2"
Nothing Special. I tried changing that to mysql, or just "mysql2", it doesn't work. Errors that client is not initialized when I comment the whole line.
Netbeans stopped supporting rails. See :
Ruby Dropped in Netbeans 7,How to Use it in Netbeans7?
And:
http://noteslog.com/post/netbeans-6-9-1-ruby-1-9-2-rails-3-0-0-mysql-gem-2-8-1/
Did you get a message that your user is not allowed to install gems?
Then you should try following command in your rails application root folder
bundle install --path vendor/bundle
make sure to have the configurated database.yml in the config folder before running the previous command, or run it again after creating the file.
I've downloaded and installed "rubyinstaller-1.9.2-p180.exe", then I installed gems(rubygems-1.6.2 by running 'ruby setup.rb') and the installed rails by running 'gem install rails'.
After doing all this, I've downloaded and installed RubyMine 3.1
In RubyMine I try to create new 'Rails Application' project, in the 'Rails application settings' dialog it shows above installed rub as the Ruby Interpreter, Rails Version says '3.0.5'. Rails Template is empty. 'Preconfigure for selected databases' is unchecked, and also "skip test:unit files' is unchecked.
After clicking ok, it creates some files at the top of the code there is a message "some of the required getms are note attached: sqlite3"( I didn't ask DB, so why sqlite??) anyway I click, on 'attach gems'.
After that I click on play icon, and get below errors. Please help me resolve this issues. Thanks in advance!
------------------------------
C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/kobi/RubymineProjects/deded/script/rails server -b 127.0.0.1 -p 3000 -e development
C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `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/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler.rb:120:in `require'
from C:/Users/kobi/RubymineProjects/deded/config/application.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
from C:/Users/kobi/RubymineProjects/deded/script/rails:6:in `require'
from C:/Users/kobi/RubymineProjects/deded/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
RubyInstaller for Ruby 1.9.2 doesn't support any other RubyGems version except the one which comes with the RubyInstaller. By updating RubyGems you break your Ruby installation. Please reinstall Ruby into the clean directory and don't update RubyGems.
Also, it looks like sqlite3.dll is missing from your PATH environment. Download it and unpack into RUBY_HOME\bin or c:\windows\system32. Rails needs some database and sqlite is the default.
Some native gem extensions may require DevKit installed, if you have problems installing such gems, install DevKit first.
Try this from console:
cd C:/users/kobi/rubymineprojects/deded
bundle install
I just started learning ruby on rails with "Lynda Ruby on Rails 3 Essential Training".
I finished the installation, and created rails application by writing- "rails new app".
After that when I wrote - "rails server", that's what I saw:
C:\Users\Oded\sites\simple_cms>rails server
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.r
b:2:in `require': 193: %1 is not a valid Win32 application. - C:/Ruby192/lib/r
uby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError
)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2.rb:7:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:64:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:64:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:62:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:62:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:51:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:51:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:11
2:in `require'
from C:/Users/Oded/sites/simple_cms/config/application.rb:7:in `<top (re
quired)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can you please help me find the solution?
Happy holidays,
Oded
Looks like you're missing some gems! try running bundle install... then all should work.
EDIT: make sure that your Gemfile contains the line
gem 'mysql'
before running bundle install. Bundler will get you set up for mysql, dependencies and all.
You have to go to this website and follow the directions ...
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
or in short download the connector mentioned in the article from mysql or a mirror site
Run this command:
gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32
Make sure you have the correct path to the mysql connector folder that has no spaces!!
After that is complete make sure you copy the libmysql.dll file from the connector library you unzipped and downloaded and placed that in the Ruby\bin file.
After that delete the connector libary and start it up by typing 'rails server' making sure your gem file has the line gem 'mysql' or gem 'mysql2' I'm not sure which one so try both. It sucks and they really need to fix this for windows.