uninitialized constant Motion::Project::Config::Rake - rubymine

I'm getting this error after upgrading rubymotion.
/Users/Anthony/.rvm/rubies/ruby-1.9.3-p392/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/Anthony/dev/mytrip_ios/Rakefile
/Library/RubyMotion/lib/motion/project/config.rb:26:in `<class:Config>': uninitialized constant Motion::Project::Config::Rake (NameError)
from /Library/RubyMotion/lib/motion/project/config.rb:25:in `<module:Project>'
from /Library/RubyMotion/lib/motion/project/config.rb:24:in `<module:Motion>'
from /Library/RubyMotion/lib/motion/project/config.rb:24:in `<top (required)>'
from /Users/Anthony/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Anthony/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Library/RubyMotion/lib/motion/project.rb:26:in `<top (required)>'
from /Users/Anthony/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Anthony/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Library/RubyMotion/lib/motion/project/template/ios.rb:29:in `<top (required)>'
from /Users/Anthony/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Anthony/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Anthony/dev/mytrip_ios/Rakefile:3:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
my rake file starts like this
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'rubygems'
whats wrong with my config?

"from /Users/Anthony/dev/mytrip_ios/Rakefile:3:in `'"
Since you are using Ruby > 1.9, you do not need to require rubygems in general.
Furthermore, rubymotion does not handle 'require' statements like regular ruby.
Please take a look at the motion-bundler gem if you are interested in loading ruby classes and extensions from the standard library.

Related

Cocoapods load error. $ pod init -> LoadError

I installed cocoapos with $sudo gem install cocoapods and then entered $ pod init
Now I get this error
Traceback (most recent call last):
15: from /usr/local/bin/pod:23:in `<main>'
14: from /usr/local/bin/pod:23:in `load'
13: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:36:in `<top (required)>'
12: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
11: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
10: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:17:in `<top (required)>'
9: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:23:in `<module:Pod>'
8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
6: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core.rb:3:in `<top (required)>'
5: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core.rb:38:in `<module:Pod>'
4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/specification.rb:8:in `<top (required)>'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- cocoapods-core/specification/json (LoadError)
My system:
macOS 10.15.1
xcode 11.3
Swift version 5.1.3

Rails migration error with thumbs_up gem

I am using the thumbs_up gem to create a voting system. I am using PostgreSQL. When I run:
rails generate thumbs_up
I get the following error:
/usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thumbs_up-0.6.7/lib/generators/thumbs_up/thumbs_up_generator.rb:21:in `create_migration': wrong number of arguments (3 for 0) (ArgumentError)
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/railties-4.0.4/lib/rails/generators/migration.rb:65:in `migration_template'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thumbs_up-0.6.7/lib/generators/thumbs_up/thumbs_up_generator.rb:22:in `create_migration'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/railties-4.0.4/lib/rails/generators.rb:156:in `invoke'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/railties-4.0.4/lib/rails/commands/generate.rb:11:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/railties-4.0.4/lib/rails/commands.rb:48:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
How do I fix this?
This is a bug in thumbs_up.
Check this issue on github: https://github.com/bouchard/thumbs_up/issues/96
I stumbled across the same error and fixed it with the help of the link above.
Apparently all you have to do is change a file in the thumbs_up gem (you will find the location of that gem in the error itself).
In file
[path to gem]/lib/generators/thumbs_up/thumbs_up_generator.rb
replace
def create_migration
migration_template 'migration.rb', File.join('db', 'migrate', 'thumbs_up_migration.rb')
end
with
def create_thumbs_up_migration
migration_template 'migration.rb', File.join('db', 'migrate', 'thumbs_up_migration.rb')
end
in your Gemfile require the gem this way:
gem 'thumbs_up', git: 'https://github.com/bouchard/thumbs_up.git', ref: 'f499a7c803c0a9fdcefe4275f2f0a10ca7964508'
then run
rails generate thumbs_up
This should work. Worked for me - hope this helps....

"Could not find a JavaScript runtime." during executing the refinerycms command

I am working on Ubuntu 12.04.
I am trying to create a new website with Refinery CMS.
I read the official Getting Started guide, and executed the following command.
$ refinerycms rickrockstar
But I got the following error message:
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
rake db:create
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
(See full trace by running task with --trace)
generate refinery:cms --fresh-installation
/home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
from /srv/samba/share/refinery2test/rickrockstar/config/application.rb:13:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.8/lib/rails/commands.rb:24:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.8/lib/rails/commands.rb:24:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've pasted the entire output on Gist because it was too long.
Strangely, I tried the same command some days before, and at that time everything worked fine.
Why does this happen? How can I solve it?
Maybe you could sudo apt-get install nodejs or see this post ExecJS and could not find a JavaScript runtime
To solve it I did:
Run refinerycms rickrockstar - it will fail with exception you described
Edit rickrockstar/Gemfile and uncomment *gem 'therubyracer', :platforms => :ruby* and save changes;
Run refinerycms rickrockstar again
Gemfile will have a conflict and ask if you want to override it. Answer no;
Override other files with conflicts
cd rickrockstar
rails s

Cap deploy error find_file_in_path: no such file foud

I'm using capyfony + symfony2.
cap deploy
/var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:183:in `find_file_in_load_path': no such file to load -- (LoadError)
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:171:in `load_from_file'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:89:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `each'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `load'
from Capfile:3:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:93:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:89:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `each'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:65:in `each'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:31:in `execute!'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:14:in `execute'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/bin/cap:4:in `<top (required)>'
from /usr/local/bin/cap:19:in `load'
from /usr/local/bin/cap:19:in `<main>'
I got the same issue. By investigating, I tried to put:
puts Gem.find_files('symfony2.rb')
In my Capfile file, as mentioned on https://github.com/everzet/capifony/issues/190. Yet, it returns nothing. I think I miss this file. How can I get it?
Edit :
After more investigating, I finally find the solution.
I used a Capfile for Capifony 2.1.16. It seems the new version of Capifony (2.2) requires some changes in the Capfile file. With the following it should work:
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/bundles/*/*/recipes/*.rb'].each { |bundle| load(bundle) }
load Gem.find_files('capifony_symfony2.rb').last.to_s
load 'app/config/deploy'

undefined method `gsub'...(NoMethodError) for docusign

After installing the docusign gem and dependent soap4r gem via github (git://github.com/felipec/soap4r.git), I get this issue when trying to run the server
user$ rails s
/Users/user/.rvm/gems/ruby-1.9.3-p125/bundler/gems/soap4r-5372d16ab9a9/lib/xsd/charset.rb:13: warning: variable $KCODE is no longer effective
/Users/user/.rvm/gems/ruby-1.9.3-p125/bundler/gems/soap4r-5372d16ab9a9/lib/soap/property.rb:68: warning: encoding option is ignored - u
/Users/user/.rvm/gems/ruby-1.9.3-p125/bundler/gems/soap4r-5372d16ab9a9/lib/soap/property.rb:69: warning: encoding option is ignored - u
/Users/user/.rvm/gems/ruby-1.9.3-p125/bundler/gems/soap4r-5372d16ab9a9/lib/soap/property.rb:70: warning: encoding option is ignored - u
/Users/user/.rvm/gems/ruby-1.9.3-p125/gems/docusign-0.8.0/lib/docusign/request_recipient_token_client_urls.rb:5:in `block in <class:RequestRecipientTokenClientURLs>': undefined method `gsub' for :onSigningComplete:Symbol (NoMethodError)
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/docusign-0.8.0/lib/docusign/request_recipient_token_client_urls.rb:5:in `map'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/docusign-0.8.0/lib/docusign/request_recipient_token_client_urls.rb:5:in `<class:RequestRecipientTokenClientURLs>'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/docusign-0.8.0/lib/docusign/request_recipient_token_client_urls.rb:2:in `<module:Docusign>'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/docusign-0.8.0/lib/docusign/request_recipient_token_client_urls.rb:1:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/docusign-0.8.0/lib/docusign.rb:36:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `block in require'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
from /Users/user/Documents/Aptana Studio 3 Workspace/reaslo/config/application.rb:7:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.1/lib/rails/commands.rb:53:in `require'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.1/lib/rails/commands.rb:53:in `block in <top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap'
from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>
I investigated
request_recipient_token_client_urls.rb
but only found
CALLBACKS = instance_methods.select { |m| m =~ /^on/ }.reject { |m| m =~ /=/ }.map { |m| m.gsub(/^on/, '').underscore }
I don't understand what is going wrong here. I can only suspect that there is an issue with soap4r because I had to install it via a github version that is compatible with ruby 1.9
That code snippet is incorrect; it's trying to call gsub on one of the method names returned by instance_methods, which are symbols, not strings. I'm guessing the top-of-tree in git is not stable here.