mime-types issue with ironworker upload - ironworker

I am trying to upload a worker and remotely build it in my .worker file. I get this error message.
You have already activated mime-types 2.0, but your Gemfile requires
mime-types 1.25. Using bundle exec may solve this.
I have tried uninstalling mime-types and installing mime-types 1.25, but that didn't seem to fix it either.

oh add this to .worker file:
#use_local_iron_worker_ng = true
from:
https://github.com/iron-io/iron_worker_ruby_ng/issues/159

Related

jekyll error building page related to kramdown parser

Whenever I run the bundle exec jekyll serve it returns the error
Dependency Error: Yikes! It looks like you don't have kramdown-parser-gfm or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- kramdown-parser-gfm' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
Liquid Exception: kramdown-parser-gfm in /_layouts/default.html
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
kramdown-parser-gfm
so, I tried gem install kramdown-parser-gfm, but it returns the same error after that.
I also tried to remove and reinstall the jekyll and bundle, but didn't work either.
jekyll version 3.9.0 Bundler version 2.1.4
I added gem "kramdown-parser-gfm" to the Gemfile and then ran bundle install.
Now the serve command completes successfully.
delete the Gemfile.lock file
go to gem file add gem "kramdown-parser-gfm"
open terminal and give command bundler
after install all packages, in terminal give command bundle exec jekyll serve
I hope application will run properly now.
On Windows
If you open your gemfile, you will notice the following.
gem "jekyll", "~> 3.2.1"
If you have the specific jekyll version and after running "bundler", you will receive the following errors.
Bundler could not find compatible versions for gem "kramdown":
In Gemfile:
jekyll (~> 3.2.1) was resolved to 3.2.1, which depends on
kramdown (~> 1.3)
kramdown-parser-gfm was resolved to 1.1.0, which depends on
kramdown (~> 2.0)
Remove the specific version of jekyll, like so:
gem "jekyll"
Do not forget to add webrick gem to gemfile
gem "webrick"
Run bundler again.
bundler
Finally, serve
bundle exec jekyll serve --livereload
What worked for me was to add:
gem "rexml"
to the Gemfile.

How can I tell jruby-jars to use a patched version of JRuby?

In my rather unique application needs, I've had to make a patch to JRuby-1.7.26. However, I've learned that Warbler (that uses jruby-jars) embeds it's own copy of JRuby into my lib/ directory. How can I configure either Warbler or jruby-jars to consider my patch when it compiles JRuby?
you need to build a custom version of jruby-jars gem (from the JRuby source)
and then specify that version to be used in the Gemfile :
gem 'jruby-jars', '1.7.26.PATCH', require: false

Jruby/Vert.x, Setup issue

I just recently learned about Vert.x and would like to try it out but I am running into some issues.
I can get a server up written in javascript but cannot get the ruby (jruby) version to run.
May 04, 2012 1:50:57 PM org.vertx.java.core.logging.impl.JULLogDelegate error
SEVERE: backtrace is
/home/curtis/.rvm/rubies/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
require'
/home/curtis/.rvm/gems/ruby-1.9.3-p125/gems/json-1.6.6/lib/json/ext.rb:13:in
Ext'
/home/curtis/.rvm/gems/ruby-1.9.3-p125/gems/json-1.6.6/lib/json/ext.rb:12:in
JSON'
/home/curtis/.rvm/gems/ruby-1.9.3-p125/gems/json-1.6.6/lib/json/ext.rb:9:in
(root)'
/home/curtis/.rvm/gems/ruby-1.9.3-p125/gems/json-1.6.6/lib/json/ext.rb:36:in
require'
/home/curtis/.rvm/gems/ruby-1.9.3-p125/gems/json-1.6.6/lib/json.rb:58:in
JSON'
/home/curtis/.rvm/gems/ruby-1.9.3-p125/gems/json-1.6.6/lib/json.rb:54:in
(root)'
/home/curtis/.rvm/gems/ruby-1.9.3-p125/gems/json-1.6.6/lib/json.rb:59:in
require'
/home/curtis/src-files/vert.x-1.0.beta11/bin/../lib/ruby/core/event_bus.rb:16:in
(root)'
/home/curtis/src-files/vert.x-1.0.beta11/bin/../lib/ruby/core/event_bus.rb:26:in
(root)'
/home/curtis/src-files/vert.x-1.0.beta11/bin/../lib/ruby/vertx.rb:1:in
`(root)'
This is what happens when I try to simply run the webapp example located in the vert.x-1.0.beta11/examples/ruby/webapp directory. I do have Jruby installed (through rvm)
$ jruby-1.6.6 -v jruby 1.6.6 (ruby-1.8.7-p357) (2012-01-30 5673572)
(OpenJDK Client VM 1.7.0_147-icedtea) [linux-i386-java]
I also have the reccomended JDK/JRE version installed. With the correct paths
.bashrc (bottom)
PATH=$PATH$HOME/.rvm/bin:$HOME/src-files/vert.x-1.0.beta11/bin:/usr/lib/jvm/java-1.7.0-openjdk-i386
I am running into a brick wall sort of, the error messages either don't help much or lead me to believe there is simply a bug in vert.x or jruby.
Advice please?
JRUBY_HOME=$HOME/.rvm/rubies/jruby-1.6.6
Make sure you have json gem installed, it's a prerequisite for the running the ruby version as stated on the vert.x website. Since you're using rvm you can switch to jruby, rvm use [jruby-version] if you've not already and try searching for the json gem as shown below.
gem search json
What is the result when you issue the command above. If you didn't get any response, you can get it installed in your jruby by using this command,
jruby -S gem install json
On the lighter side you should also install yard gem if you want to build the ruby API doc. Hope this helps.
Is the PATH line in your .bashrc just as you wrote here? If so, you need a slash in between $PATH and $HOME. Also, I think rvm likes to have the rvm sourcing line as the last thing in .bashrc, like the following:
# RVM -- don't put anything after this.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

Rails and MySQL - ActiveRecord::ConnectionNotEstablished in production environment

I'll try to be short:
Using Rails 3.2.1 and mysql2 for databases; running on Ubuntu 11.10
In development environment everything works just fine
When I start my server (WEBrick) in production, it boots up fine, but after loading any page, it raises the following error:
ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
activerecord (3.2.1)
lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in
retrieve_connection'
activerecord (3.2.1)
lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in
`retrieve_connection'
activerecord (3.2.1)
lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in
`connection'
...
/home/metjush/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:in
`service'
/home/metjush/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/home/metjush/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in `block
in start_thread'
After trying to find any possible source of error, and consulting like a billion different websites and similar reports, I am still not able to find what's wrong. My database.yml (running on localhost right now, and have my settings in production environment the same as for development, which works) is fine, my Gemfile is alright (gem 'mysql2' included, don't worry), the production database is created and rake db:migrate had no problems migrating it... Any other possible source of error I did not think of or did not find on the internet?
I stress, this only happens in production
Thanks for your help
EDIT Posting my Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.1'
gem 'mysql2'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'bcrypt-ruby', :require => 'bcrypt'
gem 'rufus-scheduler'
gem 'gmaps4rails'
Hope this helps - although I don't really see anything wrong with it.
EDIT TWO
Oddly enough, I have no problems when I start the rails console in the production environment - MySQL queries work, model instances can be saved without problems. I only get the aforementioned error when I try to access the database from the browser.
For me it came down to a misconfigured database.yml file. To confirm the correct formatting you can do the following from the directory where the .yml file is stored:
irb
require 'yaml'
a = YAML::load(File.open("database.yml"))
if you have an error you'll see something like this in response...
irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> a = YAML::load(File.open("database.yml"))
Psych::SyntaxError: (<unknown>): could not find expected ':' while scanning a simple key at line 17 column 3
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:151:in `parse'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:127:in `load'
from (irb):2
from C:/Ruby193/bin/irb:12:in `<main>'
In my case, I forgot to leave a space after the ":" when entering the database password.
i had the same issue. Spree latest version is still not compatible with rails 3.2.0/3.2.1
so use the rails 3.1.3 and the latest spree version
In my case, rails version was 3.2.0 and spree default version was 0.40.0. i changed spree version to 1.0.0.rc3 and that shown me rails compatibility issue, so i changed rails version to 3.1.3 and all went fine.
You can use the latest spree stable version i guess its 0.70.3.
you have to create a mysql database first. and then go to your application directory and edit database.yml file (~/config/database.yml) with your database information.
like:
development:
adapter: msql2
database: your database path
username: mysql username
password: mysql password
pool: 5
timeout: 5000
I encountered a similar problem in a Rails engine gem, and eventually tracked it down to a scope declaration (eg: scope :owing, where...) on one of the classes. Commenting that out resolved the ActiveRecord::ConnectionNotEstablished but resulted in a failing spec (obviously).
The engine is using the Combustion gem to include a minified rails app for specs, and the problem occurred regardless of db type. Hope that helps in some way.
Edit: Here's a rails issue for it.
You've probably already moved on with this but in case someone else gets to this page, here are a couple of things to try.
Are you sure there are no typos when you try to launch the server in production mode?
bundle exec rails s --environment=production
If there is a typo in "production" rails will not complain when it tries to start the server but it will try to look for that typo in the database.yml file and since it does not exist you will get the error you mentioned
Another thing to try: Check whether you database.yml file is formatted correctly. YAML is really picky with tabs and spaces so double check by doing the following in your console
irb
require 'yaml'
a = YAML::load(File.open("config/database.yml"))
If you get a hash back then your file is fine, otherwise fix the problem that was returned

JRuby EventMachine no such file to load

I have intalled EventMachine in JRuby (I am using Win32). When I try the server example, I get an error when
require 'eventmachine'
The error is:
C:\dev\em>jruby server.rb
server.rb:1:in `require': no such file to load -- eventmachine (LoadError)
from server.rb:1
But the gem is installed!
C:\dev\myapp>jruby -S gem install eventmachine
Successfully installed eventmachine-0.12.8-java
1 gem installed
Installing ri documentation for eventmachine-0.12.8-java...
Installing RDoc documentation for eventmachine-0.12.8-java...
Could not find main page README
Could not find main page README
Could not find main page README
Could not find main page README
You need to first load RubyGems,
require 'rubygems'
The gem may not be installed for jruby. Try jgem install eventmachine