Cannot run project.

I'm starting in Ruby on Rails, I downloaded trial version of RubyMine 3.1.1 but I can't run the project.
I have not done any change in the project, but when I open the project and press 'Run' I get the following errors:

C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/Owner/RubymineProjects/Mytest/script/rails server -b 127.0.0.1 -p 3000 -e development
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/resolver.rb:280:in `resolve': Could not find gem 'mysql2 (~> 0.2.6)' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/resolver.rb:160:in `start'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/resolver.rb:128:in `block in resolve'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/resolver.rb:127:in `catch'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/resolver.rb:127:in `resolve'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/definition.rb:151:in `resolve'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/definition.rb:90:in `specs'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/definition.rb:135:in `specs_for'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/definition.rb:124:in `requested_specs'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/environment.rb:23:in `requested_specs'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:11:in `setup'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler.rb:107:in `setup'
 from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/setup.rb:17:in `<top (required)>'
 from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
 from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
 from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
 from C:/Users/Owner/RubymineProjects/Mytest/config/boot.rb:6:in `<top (required)>'
 from <internal:lib/rubygems/custom_require>:29:in `require'
 from <internal:lib/rubygems/custom_require>:29:in `require'
 from C:/Users/Owner/RubymineProjects/Mytest/script/rails:5:in `<top (required)>'
 from -e:1:in `load'
 from -e:1:in `<main>'

Process finished with exit code 1




I have installed Ruby 1.9.2, Rails 3.0.9, rubygems 1.8.5 and apparently the 'mysql2' gem was succesfully install, but nothing works.
What is the problem with this?
6 comments
Comment actions Permalink

Hello Luis,

Could you please launch the commandline generated by RubyMine within terminal?

Regards,
Oleg

0
Comment actions Permalink

I'm sorry, what command line generated by Rubymine?
I just open a project with the mysql2 gem and try to run it with the code generated automatically by Rubymine to see what is shown and to try to begin to program but I get the mentioned errors  (by the way, I'm working on Windows).

0
Comment actions Permalink

Sorry,

I should have been more clear, could you please launch the following command line within terminal?

C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/Owner/RubymineProjects/Mytest/script/rails server -b 127.0.0.1 -p 3000 -e development


Regards,
Oleg

0
Comment actions Permalink

Thank you,
the command returned this:

←[31mCould not find gem 'mysql2 (~> 0.2.6)' in any of t
your Gemfile.←[0m
←[33mRun `bundle install` to install missing gems.←[0m



So, should I launch a command like 'bundle install mysql2' or 'bundle install'?
0
Comment actions Permalink

But when I launch 'bunlde install' or 'bundle install mysql2' it returns this:
Could not locate Gemfile

0
Comment actions Permalink

Now when I launch 'bundle install' on the project directory it returns and error again:

C:\Users\Owner\RubymineProjects\Mytest>bundle install
Fetching source index for http://rubygems.org/
Using rake (0.9.2)
Using abstract (1.0.0)
Using activesupport (3.0.9)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.9)
Using erubis (2.6.6)
Using rack (1.2.3)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.29)
Using actionpack (3.0.9)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.19)
Using actionmailer (3.0.9)
Using arel (2.0.10)
Using activerecord (3.0.9)
Using activeresource (3.0.9)
Using bundler (1.0.15)
Installing mysql2 (0.2.11) with native extensions C:/Ruby192/lib/ruby/site_ruby/
1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR:
Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        C:/Ruby192/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... yes
checking for main() in -llibmysql... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby192/bin/ruby
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-libmysqllib
        --without-libmysqllib


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.
2.11 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.11/ext/mysql2/g
em_make.out
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `b
lock in build_extensions'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:504:in `e
ach'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:504:in `b
uild_extensions'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:180:in `i
nstall'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/sour
ce.rb:101:in `block in install'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/ruby
gems_integration.rb:78:in `preserve_paths'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/sour
ce.rb:91:in `install'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/inst
aller.rb:58:in `block (2 levels) in run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/ruby
gems_integration.rb:93:in `with_build_args'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/inst
aller.rb:57:in `block in run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec
_set.rb:12:in `block in each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec
_set.rb:12:in `each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec
_set.rb:12:in `each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/inst
aller.rb:49:in `run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/inst
aller.rb:8:in `install'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/cli.
rb:222:in `install'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vend
or/thor/task.rb:22:in `run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vend
or/thor/invocation.rb:118:in `invoke_task'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vend
or/thor.rb:246:in `dispatch'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vend
or/thor/base.rb:389:in `start'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/bin/bundle:13:in
`<top (required)>'
        from C:/Ruby192/bin/bundle:19:in `load'
        from C:/Ruby192/bin/bundle:19:in `<main>'

0

Please sign in to leave a comment.