after running bundle install with rubymine still gems are missing - ruby

I started a new rails application project with rubymine.
After that Rubymine ran a bundle install.
project did not succeed in running
on one project - with no mysql definition the error is
gemnotfound - could not find gem sqlite
on one project - with mysql definition the error is
gemnotfound - could not find gem mysql2
Does someone have an idea what are those ?
shouldnt bundle install brought me those?
How can I start a simple rails project using rubymine?
Is there a good tutorial with all these issues ?
Thanks you.

RubyMine may not be able to install these gems automatically as they depend on native libraries that may not be available on your system. You also need DevKit installed and working in order to install native extensions.
I suggest you to read related posts:
Cannot install mysql2 gem
Installing SQLite 3.6 On Windows 7
You can also use sqlite-ruby instead, as for the above gems you need sqlite3.dll and libmysql.dll in PATH.
Google is your friend, it's not that hard to find various installation guides.

Related

Bundler could not find compatible versions for gem "sysrandom"

After installing PentestBox for installing penetration testing tools on windows 10 It was working great but some of the tools was outdated like metasploit, so I tried updating all using PentestBox Update Manager, but after finishing the update msfconsole keeps giving me this error
Bundler could not find compatible versions for gem "sysrandom":
In Gemfile:
metasploit-framework x86-mingw32 was resolved to 5.0.0, which depends on sysrandom x86-mingw32
Could not find gem 'sysrandom', which is required by gem 'metasploit-framework', in any of the sources.
and i literally suck in ruby language on general so what should i do ?
The version of metasploit you linked to doesn't appear to have been updated in a few years. It doesn't list sysrandom as a dependency in the Gemfile.
There's a newer version which does have sysrandom as a dependency, here:
https://github.com/rapid7/metasploit-framework/blob/master/metasploit-framework.gemspec#L106
I'm not sure why pentestbox is using such an old version, but I'm assuming the "update" actually updates to the rapid7 version of metasploit (because it's looking for sysrandom which only exists there).
There are a few things you can try:
bundle install should install all the dependencies (without using the console tool built for pentestbox)
Deleting the Gemfile.lock and running bundle install. I don't usually recommend this but if there seems to be a version mismatch somewhere and sometimes this resolves dependencies errors. You should be able to re-check this file out again (assuming it's versioned locally)
If you can post the git commit hash of the metasploit version you've downloaded that might help provide additional suggestions for resolving.

Rubymine debugging

I have Installed
2017.1.5 Version of Ruby
ruby-2.4.1-p111
I've made a new project and named it hello.rb. When I run it, everything works fine. However when I try to debug the project I get a prompt message
The gem debase required by the debugger is not currently installed. Would you like to install?
Error running hello. Following gems were not installed:
I've tried re-installing everything and restarting and I don't know what is the problem.
Well apparently debugger in RubyMine does require this gem. So You have multiple ways of doing this.
Assuming your File > Settings > Languages & Frameworks > Ruby SDK and Gems
contains only one ruby version and its the selected one (and the gem really isn't in the list). As halfelf said in your terminal/cmd/iterm you would simply write
gem install debase
Also you could create file called Gemfile that would have all the gems in
source 'http://rubygems.org'
gem 'debase'
and in the future any other gems you would need, Rubymine should be able to install those for you.
If you would have already installed the gem, there might be a gem installation conflict that would need to be resolved.

Apache/Ruby/Passenger misconfigured after Ubuntu 12.04 to 14.04 update

Well, I have to admit, that I'm down today. I've updated my Ubuntu and that rendered Redmine 2.1.2 completely dead. Any suggestions as of to what should I update or reconfigure? I'm trying not to use Ruby/Rails/Passenger blindly but it's tough as it's not my expertise. I'd like to USE Redmine instead.
Top of the Passenger error log is below, but feel free to check whole page at http://redmine.teacloud.net:
It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:
bundle install
If that didn't work, then the problem is probably caused by your application being run under a different environment than it's supposed to. Please check the following:
Is this app supposed to be run as the nobody user?
Is this app being run on the correct Ruby interpreter? Below you will see which Ruby interpreter Phusion Passenger attempted to use.
-------- The exception is as follows: -------
Could not find rake-10.3.2 in any of the sources (Bundler::GemNotFound)
/var/lib/gems/1.8/gems/bundler-1.3.4/lib/bundler/spec_set.rb:92:in `block in materialize'
• I have no idea, what user should this app supposed to be run as. Everything else uses www-data by default, however the redmine application folder in filesystem is owner by root.
• Everything was working for two years on ruby 1.8 that is not on my system now. I've managed to install lowest version 1.8.7, latest 2.1.2... and I have no idea where does the 1.9.1 get from.
• I don't understand how 'bundle install' and 'bundle update' is related to current ruby version switched to using rvm.
• I am not sure, at what point will my Redmine MySQL database be migrated or destroyed if I'll need to upgrade Redmine (so I have backup).
• bundle install didn't help, Apache runs ruby 1.9.1
Solution was simply as follows (whole failure path is documented here http://www.redmine.orgenter code here/boards/2/topics/43500?r=43514):
• Everything happens in the Redmine's installation folder:
• Went to GitHub (https://github.com/redmine/redmine/blob/master/Gemfile) and copied fresh database section to Redmine's Gemfile (ignoring the fact that I have Redmine 2.1.2 and Gemfile is far newer)
$ rvm use system
$ bundle install

Error installing debug_inspector 0.0.2 Native Extensions?

Getting this error when trying to do a bundle install. Following the instructions to do a direct gem install fails as well. I have since wiped all ruby (and project code) from my machine including any ruby configuration and reinstalled ruby, devkit, and my project code. Still getting this. Not sure where to look next. Most searches turn up gem-specific solutions that don't seem to apply here. Let me know if I can provide more info. Thanks!
An error occurred while installing debug_inspector (0.0.2), and Bundler cannot
continue.
Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before
bundling.
C:\TFS\Grange Commercial SEQ\White\Specifications>gem install debug_inspector -v
'0.0.2'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
The system cannot find the path specified.
ERROR: Error installing debug_inspector:
ERROR: Failed to build gem native extension.
C:/devl/Ruby/Ruby192/bin/ruby.exe extconf.rb
Gem files will remain installed in C:/devl/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems
/debug_inspector-0.0.2 for inspection.
Results logged to C:/devl/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/debug_inspector-
0.0.2/ext/debug_inspector/gem_make.out
I know this question is very old. However, I see two problems with this right off.
Windows doesn't have the tools (by default, or using the ruby installer) to compile c dependencies for ruby. If you want to do it yourself, you might check out: http://rubylearning.com/blog/how-do-i-install-a-ruby-gem-with-native-extensions-on-windows/
The other problem is that this particular gem doesn't work with ruby < 2.0: https://github.com/banister/debug_inspector and your ruby version appears to be 1.9.1
I would check your Gemfile.lock to see which gems are requiring debug-inspector. If you can do without them, take them out, and your bundle will succeed. If you must have them, try running a linux VM and using it for your development. My personal suggestion would be Ubuntu: http://www.ubuntu.com/download/desktop and VirtualBox or VMWare Player. Virtual Box is FOSS, so if this is company work, you'll have to use it: https://www.virtualbox.org/ . VMWare Player is free for personal use, and I like how it works a little better: http://www.vmware.com/products/player
I got the same error, using Ruby 2.2.4 64bit, on windows 10 64.
In my case what caused the error was installing several ruby versions, one after the other- (to try and solve that error)
Eventually I solved it by running ruby dk.rb install --force (At first I did that without the force flag), as stated by this answer- Just make sure to use the correct ruby version- version that worked for me was ruby 2.1.7 32bit.

Rails server command generates error report

When I used rails server command, found following errors in terminal. It shows that "could not find a JavaScript runtime". I am newbie in ROR and don't know to configure different files. I Google and found solutions of this problem 1 2 3. Still I am not getting the things. Please suggest some solutions.
Ruby and Rail versions on my system
Ruby version:- ruby 1.8.7 , Rails version:- Rails 3.2.6
I suppose you lack executable on your system/
Haven't you try to run gem install execjs or bundle install(from your project directory) in console?
UPDATE
Also visit execjs homepage and try instaling any of JS runtimes supported.
UPDATE 2
I was able to reproduce your error (with ruby 1.9.2). Just add gem 'therubyracer' to your Gemfile and run bundle install. For some weird reason ROR is not working out of the box on Ubuntu. See this and search for runtime word for more info.
PS
Please put your Gemfile here. This might help.
The error message also tells your to
See https://github.com/sstephenson/execjs for a list of available runtimes.
You have to install one of the JavaScript runtimes listed there:
therubyracer
therubyrhino
Node.js
Microsoft Windows Script Host
For Rails 3.2.6 I suggest to use Ruby 1.9.3. for better performance.

Resources