This forum is no longer active. Please post your questions to our new community site

Forums Redmine

Difficulty creating plugins

Subscribe to Difficulty creating plugins 5 post(s), 4 voice(s)

 
Avatar mdobrin26 1 post

Hi, I’m a newbie and need detailed assistance with how to get started creating plugins.

1) I downloaded and installed BitNami Redmine 0.9.1 on Windows XP.

2) I have successfully started up the BitNami Redmine command prompt and I navigate to C:\Program Files\BitNami Redmine Stack\apps\redmine. Ruby and MySQL commands both seem to be recognized.

3) I am following the plugin tutorial on the redmine website:
http://www.redmine.org/wiki/1/Plugin_Tutorial

4) I have completed step 1 and successfully set my RAILS_ENV variable with the command “set RAILS_ENV=”production"

5) I cannot complete step 2, which is for generating a sample plugin file. I enter the following:

ruby script/generate redmine_plugin Polls

and receive the following error:

./script/../config/../vendor/rails/railties/lib/initializer.rb:386:in `read’: In
valid argument – C:/Program Files/BitNami Redmine Stack/apps/redmine/config/envi
ronments/“production”.rb (Errno::EINVAL)
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:386:
in `load_environment’
from C:/Program Files/BitNami Redmine Stack/apps/redmine/vendor/rails/ac
tivesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warni
ngs’
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:379:
in `load_environment’
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:137:
in `process’
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:113:
in `send’
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:113:
in `run’
from C:/Program Files/BitNami Redmine Stack/apps/redmine/config/environm
ent.rb:20
from C:/PROGRA~1/BITNAM~1/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_re
quire.rb:31:in `gem_original_require’
from C:/PROGRA~1/BITNAM~1/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_re
quire.rb:31:in `require’
from C:/Program Files/BitNami Redmine Stack/apps/redmine/vendor/rails/ra
ilties/lib/commands/generate.rb:1
from C:/PROGRA~1/BITNAM~1/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_re
quire.rb:31:in `gem_original_require’
from C:/PROGRA~1/BITNAM~1/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_re
quire.rb:31:in `require’
from script/generate:3

Any advice would be greatly appreciated. Thanks!

-Mike

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

valid argument – C:/Program Files/BitNami Redmine Stack/apps/redmine/config/envi
ronments/“production”.rb

I think that you have to set the RAILS_ENV environment variable without quotes: set RAILS_ENV=production

Cheers.

 
Avatar shopoto 1 post

Hi everyone!

It seems that I’ve encountered the same problem as Mike.

Have you solve this one?

Il be very glad if you could tell me how to solve this one!

I m on windows Xp
Ruby 187
Rails 2.3.5
Redmine 1.0.4.stable.4543 (MySQL)
Webrick

I’m trying to generate a new plugin as explained here:
http://www.redmine.org/wiki/1/Plugin_Tutorial

My problem is when I try to use the plugin genrator here is my error:


C:\redmine>ruby script/generate redmine_plugin redmine_my_plugin
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:386:in `read’: Invalid argument – C:/redmine/config/environments/“production” .rb (Er
rno::EINVAL)
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:386:in `load_environment’
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings’
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:379:in `load_environment’
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:137:in `process’
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send’
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run’
from C:/redmine/config/environment.rb:20
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/generate.rb:1
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from script/generate:3

C:\redmine>

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

It seems that you did not set the environment properly:

“production” .rb

Try to set the environment with the following command:

set RAILS_ENV=production

and re-run the same command.

 
Avatar anicas 1 post

Hi is there recommended way of setting permissions while creating a plug in. I’m using the UBUNTU VM of redmine, I get errors all the time because of permission settings.

Forums Redmine