jruby on rails with warbler and tomcat and windows - ruby-on-rails

I tried to deploy an application.war file into webapps/ in the tomcat folder and started up the server. When i try to open http://localhost:8080/relConnections it shows on the screen that "something went wrong". I deleted the common index.html in the public folder in usual rails apps and tchanged the root to my home page.
When i see the log file it says the following:
"An exception happened during JRuby-Rack startup private method `gsub' called for nil:NilClass
--- System
jruby 1.6.7"
and three or four more excecption saying the same lines gsub nil:NilClass for all of those.
Here is my Gemfile
source 'http://rubygems.org'
gem 'jruby-jars', '1.6.7'
gem 'warbler', '1.3.2'
gem 'rails', '3.1.3'
gem 'rake', '0.9.2.2'
gem 'jruby-openssl', '0.7.5', :platforms => :jruby
gem 'json', '1.6.5', :platforms => [:jruby, :mingw, :mingw_19]
gem 'therubyrhino', :platforms => :jruby
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'activerecord-jdbc-adapter', '1.2.2'
gem 'activerecord-oracle_enhanced-adapter', '1.4.0'
gem 'mechanize', '1.0.0'
gem 'nokogiri', '1.5.0'
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :development do
gem 'ruby-debug-base', '0.10.4'
gem 'ruby-debug-ide', '0.4.17.beta8'
gem 'pry', '0.9.7.4'
end
group :test do
gem 'turn', '0.8.3', :require => false
gem 'minitest', '2.11.0'
gem 'timecop', '0.3.5'
end
gem 'jruby-pageant', '~>1.0.2'
gem 'net-ssh', '~>2.5.2'
And here is my warble.rb
Warbler::Config.new do |config|
#commented code
config.dirs = %w(app config lib log vendor tmp)
#more commented code
end
Let me know if iam missing any gems or anything else here.
Thanks

I think you may try to set the jruby version to 1.9. In the warble.rb
config.webxml.jruby.compat.version = "1.9"

Related

Having errors with rake db:create

I'm trying to install fat free crm with ruby on rails on Windows 7, but when I put the command
rake db:create RAILS_ENV=production
it says
rake aborted!
LoadError: cannot load such -- 2.1/pg_ext
Normally, it would say what gem I should install, but not in this case.
How can I solve this error?
Edit:
A friend of mine suggested to uncomment mysql2 and comment pg on the Gemfile file in the proyect like this:
gem 'mysql2'
#gem 'sqlite3'
#gem 'pg'
But now I get this:
Unable to load the EventMachine C extension; To use the pure-ruby reactor, requi
re 'em/pure_ruby'
C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': ca
nnot load such file -- 2.1/rubyeventmachine (LoadError)
Have any ideas of why this happends?
Here is my Gemfile:
source 'https://rubygems.org'
# Uncomment the database that you have configured in config/database.yml
# ----------------------------------------------------------------------
gem 'mysql2'
# gem 'sqlite3'
# gem 'pg'
# Removes a gem dependency
def remove(name)
#dependencies.reject! {|d| d.name == name }
end
# Replaces an existing gem dependency (e.g. from gemspec) with an alternate source.
def gem(name, *args)
remove(name)
super
end
# Bundler no longer treats runtime dependencies as base dependencies.
# The following code restores this behaviour.
# (See https://github.com/carlhuda/bundler/issues/1041)
spec = Bundler.load_gemspec( File.expand_path("../fat_free_crm.gemspec", __FILE__) )
spec.runtime_dependencies.each do |dep|
gem dep.name, *(dep.requirement.as_list)
end
# Remove premailer auto-require
gem 'premailer', :require => false
# Remove fat_free_crm dependency, to stop it from being auto-required too early.
remove 'fat_free_crm'
group :development do
# don't load these gems in travis
unless ENV["CI"]
gem 'thin'
gem 'quiet_assets'
gem 'capistrano'
gem 'capistrano-bundler'
gem 'capistrano-rails'
gem 'capistrano-rvm'
#~ gem 'capistrano-chruby'
#~ gem 'capistrano-rbenv'
gem 'guard'
gem 'guard-rspec'
gem 'guard-rails'
gem 'rb-inotify', :require => false
gem 'rb-fsevent', :require => false
gem 'rb-fchange', :require => false
end
end
group :development, :test do
gem 'rspec-rails', '~> 2'
gem 'headless'
gem 'debugger', :platforms => 'mri_19' unless ENV["CI"]
gem 'byebug', :platforms => ['mri_20', 'mri_21'] unless ENV["CI"]
gem 'pry-rails' unless ENV["CI"]
end
group :test do
gem 'capybara'
gem 'selenium-webdriver'
gem 'database_cleaner'
gem "acts_as_fu"
gem 'factory_girl_rails'
gem 'zeus' unless ENV["CI"]
gem 'coveralls', :require => false
gem 'timecop'
end
group :heroku do
gem 'unicorn', :platform => :ruby
gem 'rails_12factor'
end
# 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'
gem 'execjs'
gem 'therubyracer', :platform => :ruby unless ENV["CI"]
end
gem 'turbo-sprockets-rails3'
It sounds like you are missing the pg gem from your Gemfile. Is it in the development group?
Can you post your Gemfile?
Uncomment #gem pg.
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby' is a separate error. Where did you get that Gemfile?

Deploy rails 3.2 app fails with capistrano filename too long

Needs help to solve fails capistrano deploy proccess.
We attempt to deploy our app with capistrano and it fails with cash error
GemFile look like this
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'mysql2'
gem 'haml'
gem 'rake', '10.0.3'
gem 'dalli'
gem 'russian'
gem 'kaminari'
gem "rails-settings-cached"
gem 'devise'
gem 'activeadmin'
gem 'enumerize'
gem 'rack-cache', :require => 'rack/cache'
gem 'dragonfly', '~> 0.9.12'
gem 'imperavi-rails', :github => 'Paxa/imperavi-rails', :ref => 'ec989856'
gem 'awesome_nested_set'
gem 'exception_notification', '2.6.1'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'therubyracer', '0.10.2', :platforms => :ruby
end
gem 'right-rails'
group :development do
gem 'hipchat'
gem 'capistrano'
gem 'capistrano_colors'
gem 'rvm-capistrano'
end
group :production do
gem 'thin'
end
In last commit was add right-dialog js and css
How can we fix this?
Thanks.

Why am I getting this simple error when using `acts_as_taggable_on`?

I wanted to set up ActsAsTaggableOn.strict_case_match = true
According to http://5minutenpause.com/blog/2012/11/20/careful-where-you-get-your-gems-from/, it seems I have to download the gem from github. So I made it that way and tried to run App.
However, it returns this error:(
Error message: (I've tried bundle install but still the same error message!)
git://github.com/mbleigh/acts-as-taggable-on.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
Exception class:
PhusionPassenger::UnknownError
Here are my codes!
config/initializer/tag_list.rb
ActsAsTaggableOn.delimiter = ','
ActsAsTaggableOn.remove_unused_tags = true
ActsAsTaggableOn.strict_case_match = true
Gemfile
gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'
I made a try to change the source to download the gem directly from to rubyorg, not from the Github. It's just like this.
gem 'acts-as-taggable-on', '2.3.3'
Now it returns this error:(
Error message:
undefined method `strict_case_match=' for ActsAsTaggableOn:Module
How can I solve this?
UPDATE:
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'execjs'
gem 'therubyracer'
gem 'devise', '2.0.1'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'paperclip', "~> 3.0"
gem "cocaine"
gem 'mailboxer', '0.7.0'
gem 'sunspot_rails'
gem 'sunspot_solr'
group :development do
gem 'better_errors'
gem 'binding_of_caller'
#gem 'rack-mini-profiler'
end
gem 'progress_bar'
gem 'kaminari', '0.14.0'
gem "sunspot_with_kaminari", '~> 0.1'
gem 'i18n_generators'
gem 'ancestry'
gem 'acts-as-taggable-on', '2.3.3'
gem 'acts_as_commentable_with_threading'
gem 'twitter-bootstrap-rails'
gem "less-rails"
gem 'crummy', '~> 1.6.0'
gem 'rails3_acts_as_paranoid'
gem 'galetahub-simple_captcha', :require => 'simple_captcha'
gem "acts_as_follower"
gem "jpmobile"
gem "rqrcode-rails3"
gem 'acts_as_votable', '~> 0.4.0'
gem 'rails3-jquery-autocomplete'
gem "cancan"
gem 'rinku', '1.5.1'
gem 'dalli'
gem "auto_html", '1.6.0'
gem "rails_autolink"
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'jquery-ui-rails'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
The problem is that the version 2.3.3 from acts-as-taggable-on was released 9 months ago and doesn't include the strict_case_match feature.
Your Gemfile has too look this this:
gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'
the same way you had, and run:
bundle update acts-as-taggable-on
if that doesn't work, just delete your Gemfile.lock and run bundle install and bundle update
notice that its a development version of the gem, not ready for production, but you can take the risk and be a an alpha user of the gem and report any issue you find :)

Mercury: SyntaxError: cannot return a value from a constructor

Working on a fresh install of rails 3.2.8 and getting an error when compiling after adding Mercury:
SyntaxError: cannot return a value from a constructor: "this.element" in class Button
(in /home/*********/**************/vendor/bundle/ruby/1.8/bundler/gems/mercury-0c048033cd79/app/assets/javascripts/mercury/toolbar.button.js.coffee)
I've successfully installed Mercury using Rails 3.2.3, but haven't been able to figure why this wouldn't be working.
Any ideas?
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'bootstrap-sass'
gem 'simple_form'
gem 'json'
gem 'ckeditor'
gem 'mercury-rails', :git => 'https://github.com/jejacks0n/mercury.git'
gem 'jquery-rails'
# gem 'jquery-ui-rails'
gem "paperclip", "~> 2.7"
# To use ActiveModel has_secure_password
gem 'bcrypt-ruby', '~> 3.0.0'
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', '0.10.2', :platforms => :ruby
gem 'libv8', '~> 3.3.10'
gem 'execjs'
gem 'uglifier', '>= 1.0.3'
end
https://github.com/jejacks0n/mercury/issues/349
i guess you need to lock into coffeescript 1.4.0
this fixed my issue.
Apparently, there is a fix, which is in the github repo, but not on rubygems, yet. If you don't want to downgrade coffee-script, just specify the repository in the Gemfile:
# Gemfile
# ...
gem 'mercury-rails', git: 'git://github.com/jejacks0n/mercury'
and run bundle update mercury-rails, afterwards. This fixed this problem for me without the need to downgrade coffee-script.
Here's what you actually need to type into your gemfile:
gem 'coffee-script-source', '1.4.0'

Could not find bootstrap-sass-2.2.2.0

I'm trying to get Rails up and running. I'm able to run bundle install successfully, but when I attempt to start the server using rails s I get the following message:
Could not find bootstrap-sass-2.2.2.0
Run `bundle install` to install missing gems.
Here's my Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'rails_admin'
gem 'devise'
gem 'cancan'
gem 'simple_form'
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
# The following three gems are used for Bootstrap
# See: https://github.com/seyhunak/twitter-bootstrap-rails
#NOTE: For therubyracer, run "gem install libv8" and "gem install therubyracer -v '0.11.0'"
end
gem 'therubyracer', '0.11.0beta8'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem "less-rails"
gem 'bootstrap-sass', '~> 2.2.2.0'
gem 'jquery-rails'
I made a mistake by adding a gem into the gem file with a capital letter before running bundle install. Look over that you dont have any capital letters with the gems you are adding.
Should look like this:
gem 'bootstrap-sass'
Should not look like this:
gem 'Bootstrap-sass'

Resources