Can't find data_warehouse ruby gem - ruby-on-rails

I am working on a project and i was trying make it up and running in my local machine. But unfortunately the app is using a gem data_warehouse( found gem 'data_warehouse', '= 1.5.2' in environment.rb), I tried to look for this gem but can't find this gem, I was unable to run the application because of this. I never used data warehousing in ruby on rails either. I am slightly aware of the concept data warehousing. If any one aware of this gem please post the url for this gem or an alternate solution for avoiding this problem.

Neither can I. Now, assuming that you have a production machine where this gem is found:
You can see the installed gems with:
gem list
Go to production machine and run
gem env
There, you should see something like
REMOTE SOURCES:
http://gems.rubyforge.org/
http://gems.github.com/
After running the same command on your local computer, you can add the missing remote sources with:
sudo gem sources -a "http://missing_remote_sources"
and then try to install your gem.
If this doesn't work, you could also try a monkey-patch. Run
rake gems:unpack
on your production server. After this, you will be able to find your gem in the /vendor/gems folder. Copy the folder into your local vendor folder and it should work.
Btw, as it could just be a typo: have you tried commenting the line in the config file?

Related

Where are Ruby gems located on a server?

My understanding is that the gemfile in a Rails app only provides references to the actual code of these gems on your local computer. So when you're running your app locally, it's pulling the gem code from your local computer. What happens when you deploy though? The server runs your rails code, but does it also hold all the references in your gem file and automatically download them as well?
Yep. If you deploy on Heroku, you can see bundler doing its work and pulling down the gems.
As per the Bundler docs, you can use bundle show --paths to see exactly where your gems are being loaded from.
Additionally, if you aren't using bundler, you can use the command gem environment to see gem paths on the system.
See this existing answer for more info: How can I find where gem files are installed?

gem development (not load other Gemfile)

I've an issue with gem file development, for example I'm creating a gem with executable command.
It all works well, I can run command, BUT I've issue that if I'm trying to run command inside another project folder it's USING Gemfile from this second project.
Can I somehow disable it?
I want only to use Gemfile (and .gemspec) from my gem, and not with folder where it was executed.
I have a gem github.com/igorkasyanchuk/rails_db (version in master branch is not released yet, so you need to build it locally), gem build ..., then gem install ..., and then go to your project dir and run "railsdb". When you run it, it's trying to load gems from local folder Gemfile.
Thanks
Igor
If you are using the rubygems-bundler gem, executing commands provided by a gem will load the bundle of your current directory. You can prohibit this from happening for a particular gem providing commands in various ways. One way:
export NOEXEC_EXCLUDE=my_gem_command
See https://github.com/rvm/rubygems-bundler for more information about rubygems-bundler.

could not find a javascript runtime in rails and unable to instal ' therubyracer' gem - on windows

C:\sites\srhapp>rails generate controller home index
C:/Ruby21/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/runtimes.rb:48:in `au
todetect': Could not find a JavaScript runtime. See https://github.com/rails/exe
cjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
This are the error messages i get. kindly help me out .
Install nodejs. That may help here.
Follow this.
Now that you have Nodejs installed, see if any of these can help with the error you are getting (I was going to comment on jon snow's answer, but my suggestions became too long.):
Make sure you have C:\Windows\System32 in your system's PATH variable.
Close and then restart your command console.
Type node -v into the console. Does Nodejs respond?
Change the therubyracer line in your Gemfile to gem 'therubyracer', {:platforms => [:ruby]}. As far as I know, therubyracer isn't for Windows, but declaring it this way lets it still be used in Heroku if you plan on using that later. Run bundle install after you make this change.
Edit
Do you necessarily need Puma in your Windows development environment? If you only need it for deployment on Heroku, the easiest way that I have found to get around its difficulty with Windows is by putting it into the production group along with any other gems Heroku requires.
Gemfile
...
group( :production ) do
# Serves static assets in Heroku deployment.
gem 'rails_12factor'
# Web server for use with Heroku.
gem 'puma'
# Database used by Heroku.
gem 'pg'
end
...
That way, you can simply exclude those gems when you bundle install in your local development environment.
$ bundle install --without production
If you really do need Puma on a Windows environment, you will have to install OpenSSL libraries and headers (so I have heard; I haven't tried it myself). The comment by luislavena on this page should help you in that case.

Creating a gem server, which I can release gems to

I've written a few gems that I've released to rubygems using Gemcutter and the source stored on github.
I have issue that I need to create a gem that can't be open source and also not available to the community, but only to members of my team.
I am aware that I can store gems locally and target them in my Gemfile, however I'd like to be able to do
rake version:bump
rake release
or similar. That would bump the version and push it to my gem server and still keep older gems so that people can install older versions of it.
Seems like it should be fairly simple to do. I'm just missing how to do it
This is fairly simple if you have a server you can host your private gems on. Setup a subdomain, something like gems.companyname.com and setup a virtual host to host your domain. You'd point that virtual host to a folder like you would any website and setup the gem server from there.
Example:
mkdir /var/www/gemserver
mkdir /var/www/gemserver/gems
cp private-gem-0.1.0.gem /var/www/gemserver/gems
cd /var/www/gemserver
gem generate_index
/var/www/gemserver would be the root directory. Lastly all you'd need to do is add a new source to your Gemfile
source 'http://rubygems.org'
source 'http://gems.companyname.com'
So anyone that knows about your custom domain can get access to the gems. The only pain is every time you rebuild your gem you need to run the generate_index command again after you upload your gem to the gems folder.

How to install gems from RubyForge?

I am trying to install ruby-mp3info as a gem on my computer.
Running sudo gem install ruby-mp3info seems to work OK.
In my environment.rb file, I added config.gem "ruby-mp3info".
When I try to run the server, it fails, claiming I have some missing gems
Following the error message's advice:
Run `rake gems:install` to install the missing gems.
I run the command, which simply returns my local path. Running the server again - I get the same error message.
Could someone explain what I am doing wrong? How does one go about installing gems from RubyForge - or in general?
How does the gem command know where to find the necessary files - they are not all stored on my computer. Does it have hardcoded urls built into it?
Here's what did the trick.
In my environment.rb file, I had the following:
config.gem "ruby-mp3info"
Playing around with the options, I found that I had to specify the lib attribute:
config.gem "ruby-mp3info", :lib => "mp3info"
This solved the problem.
I've run into a similar problem on servers when running Phusion Passenger (mod_rails). Problem being I forget to update the Passenger gem repository like this:
/opt/ruby-enterprise-1.8.6-20090421/bin/gem install whatever
instead of simply this:
gem install whatever
It would be a useful utility for someone to write, keeping the 2 gem repos in sync.

Resources